Пример #1
0
        public void ReadValue_ForNotMatchingValue_ThrowsException()
        {
            var reader = new IntegerValueReader();

            var xmlElement = new XElement("string");

            Assert.Throws <ParserException>(() => reader.ReadValue(xmlElement));
        }
Пример #2
0
        public void ReadValue_FromElementWithIntegerValue_ReturnsCorrectIntegerValue()
        {
            var reader = new IntegerValueReader();

            var xmlElement = new XElement("int", "1234");

            var value = reader.ReadValue(xmlElement);

            Assert.IsType <IntegerValue>(value);
            Assert.Equal(1234, value.GetValue <int>());
        }