Exemplo n.º 1
0
        public List <UserModel> Get()
        {
            MongoCRUD db      = new MongoCRUD("BbgCluster");
            var       results = db.Get <UserModel>("Users");

            return(results);
        }
Exemplo n.º 2
0
        public static void Get_Should_Throws_Exception_When_Id_Is_Null()
        {
            // arrange
            var mongoClient = FakeMongoClient.GetMongoClientMock <GenericTestWithIdProperty>(true).Object;
            var mongoCRUD   = new MongoCRUD <GenericTestWithIdProperty>(mongoClient, "SomeDB");

            // act
            Exception ex =
                Assert.Throws <ArgumentNullException>(() => mongoCRUD.Get(null));

            // assert
            Assert.Equal("Value cannot be null.\r\nParameter name: id", ex.Message);
        }