コード例 #1
0
        public void Connection_ConstructorSetsProperties()
        {
            var target = new Connection(ConnectionFakes.GetFake());

            Assert.AreEqual(ConnectionFakes.Name, target.Name);
            Assert.AreEqual(ConnectionFakes.ConnectionString, target.ConnectionString);
            Assert.AreEqual(ConnectionFakes.Provider, target.ProviderName);
        }
コード例 #2
0
        public void ConnectionLibrary_IgnoresLocalSqlConnection()
        {
            var dummy = new ConnectionStringSettingsCollection();

            dummy.Add(ConnectionFakes.GetLocalSqlServer());
            dummy.Add(ConnectionFakes.GetFake());

            var target = new ConnectionLibrary(dummy);

            var result = target.GetConnections();

            Assert.AreEqual(1, result.Count);
            CollectionAssert.AllItemsAreNotNull(result);
            Assert.AreEqual(ConnectionFakes.Name, result.FirstOrDefault().Name);
        }