コード例 #1
0
		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);
			}
		}
コード例 #2
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);
			}
		}
コード例 #3
0
		public void ShouldDeleteAll()
		{
			// Arrange
			using (MongoProvider provider = new MongoProvider(ConfigSettings.MongoConnectionString))
			{
				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));
			}
		}