Ejemplo n.º 1
0
        public void StringToRegistryRecordTest_StringWithInvalidRegistryPath_InvalidRegistryPathException()
        {
            string textToConvertFrom = "Some strange text for test. Another Sentence";
            TxtToRegistryRecordSerializer txtToRegistryRecordSerialize = new TxtToRegistryRecordSerializer();

            bool exceptionWasThrown = false;

            try {
                Data.IRegistryRecord tmp = txtToRegistryRecordSerialize.StringToRegistryRecord(textToConvertFrom);
            } catch (ArgumentException) {
                exceptionWasThrown = true;
            }

            Assert.IsTrue(exceptionWasThrown);
        }
Ejemplo n.º 2
0
        public void StringToRegistryRecordTest_WhitespaceString_ExpectArgumentNullException()
        {
            string textToConvertFrom = @" ";
            TxtToRegistryRecordSerializer txtToRegistryRecordSerialize = new TxtToRegistryRecordSerializer();

            bool exceptionWasThrown = false;

            try {
                Data.IRegistryRecord tmp = txtToRegistryRecordSerialize.StringToRegistryRecord(textToConvertFrom);
            } catch (ArgumentNullException) {
                exceptionWasThrown = true;
            }

            Assert.IsTrue(exceptionWasThrown);
        }