예제 #1
0
        public void GetInt32_Nominal()
        {
            var node           = new StringKeyValueNode("bob", "123");
            var observedResult = node.GetInt32();

            Assert.Equal(123, observedResult);
        }
예제 #2
0
        public void GetInt32_ReturnMinusOne_WhenNull()
        {
            var node           = new StringKeyValueNode("bob", null);
            var observedResult = node.GetInt32();

            Assert.Equal(-1, observedResult);
        }
예제 #3
0
        public void GetInt32_ThrowException_When_NotNumber()
        {
            var node = new StringKeyValueNode("bob", "123N");

            Assert.Throws <InvalidDataException>(delegate
            {
                // ReSharper disable once UnusedVariable
                var observedResult = node.GetInt32();
            });
        }