示例#1
0
        public void CreateClient_ReturnsValidMongoClient()
        {
            // arrange
            _provider = new MongoDbProvider(_connStr, _mockMongo);

            // act
            var client = _provider.CreateClient(_connStr);

            // assert
            Assert.AreEqual(client.Settings.Server.Host, _host);
            Assert.AreEqual(client.Settings.Server.Port, _port);
        }
示例#2
0
        //[ExpectedException(typeof(ArgumentException))]
        public void CraeteClient_InvalidConnStr_ThrowsInvalidArgumentException()
        {
            // arrange
            var invalidConnStr = "invalid conn str";

            _provider = new MongoDbProvider(invalidConnStr, _mockMongo);

            // act
            var client = _provider.CreateClient(invalidConnStr);

            // assert
            Assert.IsNull(client);
        }