예제 #1
0
        public static void DeleteByQuery_Should_Works_With_Null_Filter()
        {
            // arrange
            var mongoClient = FakeMongoClient.GetMongoClientMock <GenericTestWithIdProperty>(true).Object;
            var mongoCRUD   = new MongoCRUD <GenericTestWithIdProperty>(mongoClient, "SomeDB");
            FilterDefinition <GenericTestWithIdProperty> filters = null;

            // act
            var isAcknowledged = mongoCRUD.DeleteByQuery(filters);

            // assert
            Assert.True(isAcknowledged);
        }
예제 #2
0
        public static void DeleteByQuery_Should_Works_With_Filter()
        {
            // arrange
            var mongoClient = FakeMongoClient.GetMongoClientMock <GenericTestWithIdProperty>(true).Object;
            var mongoCRUD   = new MongoCRUD <GenericTestWithIdProperty>(mongoClient, "SomeDB");
            var filters     = FilterBuilder.GetFilterBuilder <GenericTestWithIdProperty>().Eq(r => r.SomeTest, "test");

            // act
            var isAcknowledged = mongoCRUD.DeleteByQuery(filters);

            // assert
            Assert.True(isAcknowledged);
        }