> For the complete documentation index, see [llms.txt](https://docs.shouldly.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shouldly.org/documentation/equality/exampleclasses.md).

# ExampleClasses

The classes used in these samples are:

```cs
namespace Simpsons;

public abstract class Pet
{
    public abstract string? Name { get; set; }

    public override string? ToString() => Name;
}

public class Cat : Pet
{
    public override string? Name { get; set; }
}

public class Dog : Pet
{
    public override string? Name { get; set; }
}

public class Person
{
    public Person()
    {
    }

    public Person(string name)
    {
        Name = name ?? throw new ArgumentNullException(nameof(name));
    }

    public string? Name { get; set; }
    public int Salary { get; set; }

    public override string? ToString() => Name;
}
```

[snippet source](https://github.com/shouldly/shouldly/blob/master/src/DocumentationExamples/ExampleClasses.cs#L1-L35) | [anchor](#snippet-DocumentationExamples/ExampleClasses.cs)
