MongoDB.DriverUnitTests.MongoClientSettingsTests.TestServersWithOneServer C# (CSharp) Метод

TestServersWithOneServer() приватный Метод

private TestServersWithOneServer ( ) : void
Результат void
        public void TestServersWithOneServer()
        {
            var settings = new MongoClientSettings();
            Assert.AreEqual(_localHost, settings.Server);
            Assert.IsTrue(new[] { _localHost }.SequenceEqual(settings.Servers));

            var server = new MongoServerAddress("server");
            var servers = new[] { server };
            settings.Servers = servers;
            Assert.AreEqual(server, settings.Server);
            Assert.IsTrue(servers.SequenceEqual(settings.Servers));

            settings.Freeze();
            Assert.AreEqual(server, settings.Server);
            Assert.IsTrue(servers.SequenceEqual(settings.Servers));
            Assert.Throws<InvalidOperationException>(() => { settings.Server = server; });
        }