예제 #1
0
        public void Goodness_GoodEnoughString_ReturnsTrue()
        {
            BinaryStringProcessor stringProc = new BinaryStringProcessor();

            Assert.IsTrue(stringProc.IsGood("110010"), "Binary string processor goes mad!");
            Assert.IsTrue(stringProc.IsGood("1010101110010010110111001011001000"), "Binary string processor goes mad!");
        }
예제 #2
0
        public void Goodness_EmptyString_ReturnsTrue()
        {
            // Not sure is an empty string good binary string or not, behavior could be changed later on.
            BinaryStringProcessor stringProc = new BinaryStringProcessor();

            Assert.IsTrue(stringProc.IsGood(""), "Binary string processor goes mad!");
        }
예제 #3
0
        public void Goodness_NullString_ThrowsException()
        {
            BinaryStringProcessor stringProc = new BinaryStringProcessor();

            Assert.Throws <ArgumentNullException>(() => stringProc.IsGood(null), "Binary string processor goes mad!");
        }
예제 #4
0
        public void Goodness_WrongCharactersInString_ReturnsFalse()
        {
            BinaryStringProcessor stringProc = new BinaryStringProcessor();

            Assert.IsFalse(stringProc.IsGood("11ABC0010011"), "Binary string processor goes mad!");
        }
예제 #5
0
        public void Goodness_BadPrefixInBadString_ReturnsFalse()
        {
            BinaryStringProcessor stringProc = new BinaryStringProcessor();

            Assert.IsFalse(stringProc.IsGood("110010011"), "Binary string processor goes mad!");
        }
예제 #6
0
 public bool ShortAndGood() => binaryStrProcessor.IsGood(binaryString_ShortAndGood);