Testing library for creating Expected Objects.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.



Conventional Commits

ExpectedObjects is a testing library implementing the Expected Object pattern. Use of the Expected Object pattern eliminates the need to encumber system objects with test-specific equality behavior, helps to reduce test code duplication, and aids in expressing the logical intent of automated tests.



$> nuget install ExpectedObjects

Example Usage

using Xunit;

namespace MyProject.Specs
  public class CustomerServiceSpecs
    public void RetrievingACustomer_ShouldReturnTheExpectedCustomer()
      // Arrange
      var expectedCustomer = new Customer
        FirstName = "Silence",
        LastName = "Dogood",
        Address = new Address
          AddressLineOne = "The New-England Courant",
          AddressLineTwo = "3 Queen Street",
          City = "Boston",
          State = "MA",
          PostalCode = "02114"

      // Act
      var actualCustomer = new CustomerService().GetCustomerByName("Silence", "Dogood");

      // Assert

For more examples, see the documentation or browse the specifications.