public void ShouldClearAllCollections() { // Arrange using (MongoProvider provider = new MongoProvider(ConfigSettings.MongoConnectionString)) { 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 (MongoProvider provider = new MongoProvider(ConfigSettings.MongoConnectionString)) { Shipper shipper = DataProvider.PreInsertArrange(provider); // Act provider.DeleteAll<ShipperType>(); // Assert Assert.AreEqual(provider.Select<ShipperType>().Count, 0); } }
public void ShouldSelectShipperAndTreeWithExpression() { // Arrange using (MongoProvider provider = new MongoProvider(ConfigSettings.MongoConnectionString)) { Shipper shipper = DataProvider.PreInsertArrange(provider); shipper = provider.Insert<Shipper>(shipper); // Act Shipper savedTree = provider.Select<Shipper>(x => x.Id == shipper.Id).First(); // Assert Assert.IsNotNull(savedTree); Assert.AreEqual(savedTree.ShipperContacts.Count, 1); Assert.IsNotNull(savedTree.ShipperContacts[0]); } }