public void OrderDto_Property_Customer() { var order = new OrderDto(); var value = TestHelper.CustomerDto(); order.Customer = value; Assert.IsNotNull(order.Customer); Assert.IsInstanceOfType(order.Customer, typeof(CustomerDto)); Assert.AreEqual(value, order.Customer); }
public void CustomerDto_Extension_AsEntity_NotNull() { // Arrange var customer = TestHelper.CustomerDto(); // Act var result = customer.AsEntity(); // Assert Assert.IsNotNull(result); Assert.IsInstanceOfType(result, typeof(Customer)); Assert.IsNotNull(result.User); Assert.IsInstanceOfType(result.User, typeof(User)); Assert.IsNotNull(result.Orders); Assert.IsInstanceOfType(result.Orders, typeof(List <Order>)); Assert.IsNotNull(result.CreditBlocked); Assert.IsInstanceOfType(result.CreditBlocked, typeof(bool)); Assert.AreEqual(customer.CreditBlocked, result.CreditBlocked); Assert.IsNotNull(result.CreditLimit); Assert.IsInstanceOfType(result.CreditLimit, typeof(decimal)); Assert.AreEqual(customer.CreditLimit, result.CreditLimit); Assert.IsNotNull(result.AllowancePeriod_Days); Assert.IsInstanceOfType(result.AllowancePeriod_Days, typeof(short)); Assert.AreEqual(customer.AllowancePeriod_Days, result.AllowancePeriod_Days); Assert.IsNotNull(result.AllowancePeriod_Months); Assert.IsInstanceOfType(result.AllowancePeriod_Months, typeof(short)); Assert.AreEqual(customer.AllowancePeriod_Months, result.AllowancePeriod_Months); Assert.IsNotNull(result.IsPreferredCustomer); Assert.IsInstanceOfType(result.IsPreferredCustomer, typeof(bool)); Assert.AreEqual(customer.IsPreferredCustomer, result.IsPreferredCustomer); }