public void ShouldClearAllCollections() { // Arrange using (SqlProvider provider = new SqlProvider(ConfigSettings.SqlConnectionString)) { Shipper shipper = DataProvider.PreInsertArrange(provider); shipper = provider.Insert<Shipper>(shipper); // Act provider.DeleteAll<Shipper>(); // Assert Assert.AreEqual(provider.Select<Shipper>().Count, 0); Assert.AreEqual(provider.Select<ShipperContact>().Count, 0); } }
public void ShouldClearLookup() { // Arrange using (SqlProvider provider = new SqlProvider(ConfigSettings.SqlConnectionString)) { Shipper shipper = DataProvider.PreInsertArrange(provider); // Act provider.DeleteAll<ShipperType>(); // Assert Assert.AreEqual(provider.Select<ShipperType>().Count, 0); } }
public void ShouldDeleteAll() { // Arrange using (SqlProvider provider = new SqlProvider(ConfigSettings.SqlConnectionString)) { Shipper shipper = DataProvider.PreInsertArrange(provider); provider.Insert<Shipper>(shipper); // Act provider.DeleteAll<Shipper>(); // Assert Assert.IsNull(provider.SelectById<Shipper>(shipper.Id)); Assert.IsNull(provider.SelectById<Shipper>(shipper.ShipperContacts[0].Id)); } }