public void ProviderName_GetValue()
        {
            // Prepare
            var cnxStringSettingWrapper = new ConnectionStringSettingsWrapper(cnxStringSetting1);

            // Act
            var value = cnxStringSettingWrapper.ProviderName;

            // Assert
            Assert.AreEqual(value, cnxStringSetting1.ProviderName);
        }
        public void ConnectionString_GetValue()
        {
             // Prepare
             var cnxStringSettingWrapper = new ConnectionStringSettingsWrapper(cnxStringSetting1);   

            // Act
            var value = cnxStringSettingWrapper.ConnectionString;

            // Assert
            Assert.AreEqual(value, cnxStringSetting1.ConnectionString);
        }
        public void Name_SetValue()
        {
            // Prepare
            var cnxStringSettingWrapper = new ConnectionStringSettingsWrapper(cnxStringSetting1);
            var nameCnx = "DataBaseCnx";

            // Act
            cnxStringSettingWrapper.Name = nameCnx;

            // Assert
            Assert.AreEqual(cnxStringSetting1.Name, nameCnx);
        }
        public void ConnectionString_SetValue()
        {
            // Prepare
            var cnxStringSettingWrapper = new ConnectionStringSettingsWrapper(cnxStringSetting1);
            var cnxStringValue = "Data Source=ServerName;Initial Catalog=UniqueDatabase;Integrated Security=SSPI;";

            // Act
            cnxStringSettingWrapper.ConnectionString= cnxStringValue;

            // Assert
            Assert.AreEqual(cnxStringSetting1.ConnectionString, cnxStringValue);
        }
        public void Remove_BySetting()
        {

            // Prepare
            var cnxSettingWrapper = new ConnectionStringSettingsWrapper(cnxStringSetting1);
            var count = cnxStringWrapper.Count;

            // Act
            cnxStringWrapper.Remove(cnxSettingWrapper);

            // Check
            Assert.IsTrue(cnxStringWrapper.Count == count - 1);
        }
        public void GetEnumeartor()
        {
            // Prepare
            var expected = new ConnectionStringSettingsWrapper(cnxStringSetting1);

            // Act
            var item = cnxStringWrapper.GetEnumerator();
            item.MoveNext();
            var firstItem = (ConnectionStringSettingsWrapper)item.Current;

            // Check
            Assert.AreEqual(firstItem.Name, expected.Name);
        }
        public void GetElement_ByName()
        {
            // Prepare
            var expected = new ConnectionStringSettingsWrapper(cnxStringSetting2);

            // Act
            var item = cnxStringWrapper["MyCnxStringTest"];

            // Check
            Assert.True(item.Name == expected.Name);
            Assert.True(item.ProviderName == expected.ProviderName);
            Assert.True(item.ConnectionString == expected.ConnectionString);
        }
        public void Add_AddOneElement()
        {
            // Prepare
            var expected = 1;
            var cnxStringSetting = new ConnectionStringSettingsWrapper(cnxStringSetting1);
            cnxStringWrapper.Clear();

            // Act
            cnxStringWrapper.Add(cnxStringSetting);

            // Check
            Assert.True(cnxStringWrapper.Count == expected);
            Assert.True(cnxStringWrapper[0].Name == cnxStringSetting1.Name);
        }
        public void IndexOf_CorrectPosition()
        {
            // Prepare
            var expected = 1;
            var cnxSettingWrapper = new ConnectionStringSettingsWrapper(cnxStringSetting2);

            // Act
            var result = cnxStringWrapper.IndexOf(cnxSettingWrapper);

            // Check
            Assert.True(result == expected);
        }
        public void ProviderName_SetValue()
        {
            // Prepare
            var cnxStringSettingWrapper = new ConnectionStringSettingsWrapper(cnxStringSetting1);
            var providerName = "SQLNCLI";

            // Act
            cnxStringSettingWrapper.ProviderName = providerName;

            // Assert
            Assert.AreEqual(cnxStringSetting1.ProviderName, providerName);
        }
        public void GetObject_ReturnObject()
        {
            // Prepare
            var cnxStringSettingWrapper = new ConnectionStringSettingsWrapper(cnxStringSetting1);

            // Act
            var value = cnxStringSettingWrapper.GetObject();

            // Assert
            Assert.AreEqual(value, cnxStringSetting1);
        }
        public void IsReadOnly_GetValue()
        {
            // Prepare
            var cnxStringSettingWrapper = new ConnectionStringSettingsWrapper(cnxStringSetting1);

            // Act
            var value = cnxStringSettingWrapper.IsReadOnly();

            // Assert
            Assert.AreEqual(value, cnxStringSetting1.IsReadOnly());
        }