public async Task should_add_new_customer__and_then_access_that_customer_and_it_should_have_the_same_properties_I_added() { _db = new AutoResolveContext(); SUT = new CustomerAsyncRepository(_db); iAmANewCustomerEveryTime = new Customer { FirstName = "IAmTheUnitTests", LastName = "UnitTests", Email = "*****@*****.**", Telephone = "07368 27272", Title = "Mr", }; var originalName = iAmANewCustomerEveryTime.FirstName; var originalTele = iAmANewCustomerEveryTime.Telephone; var orginalEmai = iAmANewCustomerEveryTime.Email; var result = await SUT.Add(iAmANewCustomerEveryTime); result.FirstName.ShouldEqual(originalName); result.Email.ShouldEqual(orginalEmai); result.Telephone.ShouldEqual(originalTele); }
public async Task should_add_new_customer__and_return_id() { _db = new AutoResolveContext(); SUT = new CustomerAsyncRepository(_db); //some context iAmANewCustomerEveryTime = new Customer { FirstName = "IAmTheUnitTests", LastName = "UnitTests", Email = "*****@*****.**", Telephone = "07368 27272", Title = "Mr", }; var result = await SUT.Add(iAmANewCustomerEveryTime); result.ShouldBeType<Customer>(); // returns ID }