예제 #1
0
        public void IgnoreDuplicatedEntryPropertyTest(string content, string expected)
        {
            // for Input Types (Stream, File)
            foreach (var inputType in Enum.GetValues(typeof(InputTypes)))
            {
                // OUTPUT
                Debug.WriteLine("");
                Debug.WriteLine(inputType.ToString(), DebugInfo.ShortName);

                // using PrivateProfile
                using (var profile = new PrivateProfile(true))
                {
                    // ARRANGE & ACT
                    switch (inputType)
                    {
                    case InputTypes.Stream:
                        // Stream:

                        // ARRANGE
                        // (None)

                        // ACT
                        using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(content)))
                        {
                            // ACT: Read from Stream
                            profile.Read(stream);
                        }
                        break;

                    case InputTypes.File:
                        // File:

                        // File Path
                        var filepath = @$ ".\{nameof(IgnoreDuplicatedEntryPropertyTest)}.ini";
예제 #2
0
        public void IgnoreDuplicatedEntryPropertyExceptionTest()
        {
            // ARRANGE
            var profile = new PrivateProfile();
            var content = @";Test
[Section]
Key=Value1
Key=Value2
";

            using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(content)))
            {
                // ACT
                profile.Read(stream);
            }

            // ASSERT
            // (None)
        }