public void SaveConfiguration_CorrectWriteChar([Values('a', 'z', ' ', 'b')] char value)
        {
            var config = new AttributeWithOnlySectionTestConfiguration()
            {
                TestChar = value,
            };

            _iniWrapper.SaveConfiguration(config);

            _iniParser.Received(1).Write(AttributeWithOnlySectionTestConfiguration.Section, nameof(AttributeWithOnlySectionTestConfiguration.TestChar), value.ToString());
        }
        public void SaveConfiguration_CorrectWriteUint([Values(1u, 200u, 500u, 900u)] uint value)
        {
            var config = new AttributeWithOnlySectionTestConfiguration()
            {
                TestUint = value,
            };

            _iniWrapper.SaveConfiguration(config);

            _iniParser.Received(1).Write(AttributeWithOnlySectionTestConfiguration.Section, nameof(AttributeWithOnlySectionTestConfiguration.TestUint), value.ToString());
        }
        public void SaveConfiguration_ShouldSaveCorrectWriteString()
        {
            var testString = "test_string_to_save";
            var config     = new AttributeWithOnlySectionTestConfiguration()
            {
                TestString = testString,
            };

            _iniWrapper.SaveConfiguration(config);
            _iniParser.Received(1).Write(AttributeWithOnlySectionTestConfiguration.Section, nameof(AttributeWithOnlySectionTestConfiguration.TestString), testString);
        }
        public void SaveConfiguration_CorrectWriteEnum()
        {
            var config = new AttributeWithOnlySectionTestConfiguration()
            {
                TestEnum = TestEnum.Five
            };

            _iniWrapper.SaveConfiguration(config);

            _iniParser.Received(1).Write(AttributeWithOnlySectionTestConfiguration.Section, nameof(AttributeWithOnlySectionTestConfiguration.TestEnum), ((int)TestEnum.Five).ToString());
        }
        public void SaveConfiguration_CorrectWriteIntList()
        {
            var config = new AttributeWithOnlySectionTestConfiguration()
            {
                TestIntList = new List <int>()
                {
                    1, 2, 3, 4, 5, 6, 7, 8
                },
            };

            _iniWrapper.SaveConfiguration(config);

            _iniParser.Received(1).Write(AttributeWithOnlySectionTestConfiguration.Section, nameof(AttributeWithOnlySectionTestConfiguration.TestIntList), "1,2,3,4,5,6,7,8");
        }
        public void SaveConfiguration_CorrectWriteStringList()
        {
            var config = new AttributeWithOnlySectionTestConfiguration()
            {
                TestStringList = new List <string>()
                {
                    "a", "b", "c", "d", "f"
                },
            };

            _iniWrapper.SaveConfiguration(config);

            _iniParser.Received(1).Write(AttributeWithOnlySectionTestConfiguration.Section, nameof(AttributeWithOnlySectionTestConfiguration.TestStringList), "a,b,c,d,f");
        }
        public void SaveConfiguration_ReplaceNullValuesWithEmptyString()
        {
            var config = new AttributeWithOnlySectionTestConfiguration();

            _iniWrapper.SaveConfiguration(config);

            _iniParser.Received(1).Write(AttributeWithOnlySectionTestConfiguration.Section, nameof(AttributeWithOnlySectionTestConfiguration.TestUintList), string.Empty);
            _iniParser.Received(1).Write(AttributeWithOnlySectionTestConfiguration.Section, nameof(AttributeWithOnlySectionTestConfiguration.TestString), string.Empty);
            _iniParser.Received(1).Write(AttributeWithOnlySectionTestConfiguration.Section, nameof(AttributeWithOnlySectionTestConfiguration.TestInt), "0");
            _iniParser.Received(1).Write(AttributeWithOnlySectionTestConfiguration.Section, nameof(AttributeWithOnlySectionTestConfiguration.TestChar), ((char)0).ToString());
            _iniParser.Received(1).Write(AttributeWithOnlySectionTestConfiguration.Section, nameof(AttributeWithOnlySectionTestConfiguration.TestStringList), string.Empty);
            _iniParser.Received(1).Write(AttributeWithOnlySectionTestConfiguration.Section, nameof(AttributeWithOnlySectionTestConfiguration.TestUint), "0");
            _iniParser.Received(1).Write(AttributeWithOnlySectionTestConfiguration.Section, nameof(AttributeWithOnlySectionTestConfiguration.TestIntList), string.Empty);
        }
        public void SaveConfiguration_CorrectWriteListOfEnum()
        {
            var config = new AttributeWithOnlySectionTestConfiguration()
            {
                TestEnumList = new List <TestEnum>()
                {
                    TestEnum.One, TestEnum.Two, TestEnum.Three, TestEnum.Zero
                }
            };

            _iniWrapper.SaveConfiguration(config);

            _iniParser.Received(1).Write(AttributeWithOnlySectionTestConfiguration.Section, nameof(AttributeWithOnlySectionTestConfiguration.TestEnumList), "1,2,3,0");
        }