예제 #1
0
        public void TryParse_should_not_move_offset_on_invalid_input()
        {
            var offset = 1;

            PropertyFragment.TryParse(" %l", ref offset);

            offset.Should().Be(1);
        }
예제 #2
0
        public void TryParse_should_move_offset_accordingly()
        {
            var offset = 1;

            PropertyFragment.TryParse($" %p({PropNameInt})", ref offset);

            offset.Should().Be(5 + PropNameInt.Length);
        }
예제 #3
0
        public void TryParse_should_be_case_insensitive(string input)
        {
            var offset = 1;

            PropertyFragment.TryParse(input, ref offset).Should().NotBeNull();
        }
예제 #4
0
        public void TryParse_should_return_null_on_invalid_input(string input)
        {
            var offset = 1;

            PropertyFragment.TryParse(input, ref offset).Should().BeNull();
        }
예제 #5
0
        public void TryParse_should_parse_fragment_with_format()
        {
            var offset = 1;

            PropertyFragment.TryParse($" %p({PropNameDbl}:0.00)", ref offset).Should().Be(new PropertyFragment(PropNameDbl, "0.00"));
        }
예제 #6
0
        public void TryParse_should_parse_fragment_without_format()
        {
            var offset = 1;

            PropertyFragment.TryParse($" %p({PropNameInt})", ref offset).Should().Be(new PropertyFragment(PropNameInt, null));
        }