public void AddAddressTest() { int id = testAddressId; using (AddressRepository res = new AddressRepository()) { IAddress address = res.GetEntityById(id); IAddress addressNew = new biz.Address(); //address.MapPrimitiveNullOnly(addressNew); addressNew.customerId = address.customerId; //addressNew.AddressCodeID = 1; addressNew.addressLine1 = "123 Test st"; addressNew.city = "Woodbury"; addressNew.zipCode = "55125"; int addressidnew = res.Add(addressNew); IAddress address1 = res.GetEntityById(addressidnew); Assert.AreEqual(address1.addressId, addressidnew); } }
public void AddressLoggerTest() { using (AddressRepository cr = new AddressRepository()) { IAddress address = new biz.Address(); address.addressLine1 = "Test" + DateTime.Now.Second.ToString(); try { cr.Update(address); } catch (InvalidOperationException ex) { Assert.IsTrue(true, ex.Message); } catch { Assert.Fail(); } } }