コード例 #1
0
        public void Should_be_true_when_zeros_ones_same_count_and_ones_never_less_than_zeros_in_any_prefix(string input)
        {
            var  binary = new BinaryString();
            bool isGood = binary.IsGood(input);

            isGood.ShouldBeTrue();
        }
コード例 #2
0
        public void Should_be_false_when_number_zeros_are_different_than_number_ones(string input)
        {
            var  binary = new BinaryString();
            bool isGood = binary.IsGood(input);

            isGood.ShouldBeFalse();
        }
コード例 #3
0
        public void Should_be_false_when_number_ones_are_less_than_number_zeros_in_any_prefix(string input)
        {
            var  binary = new BinaryString();
            bool isGood = binary.IsGood(input);

            isGood.ShouldBeFalse();
        }
コード例 #4
0
        public void Should_be_false_when_binary_string_is_zero()
        {
            var  binary = new BinaryString();
            bool isGood = binary.IsGood("0");

            isGood.ShouldBeFalse();
        }
コード例 #5
0
        public void Should_throw_exception_when_string_is_not_a_valid_binary()
        {
            var binary = new BinaryString();

            Should.Throw <ArgumentException>(() =>
            {
                binary.IsGood("this is not a valid binary string");
            });
        }