コード例 #1
0
        public void Charge_SourceIsInvalid_ThrowsArgumentException([Values(null, "", "  ")] String source, [Values(null, true, false)] Boolean?reverse)
        {
            IBitCharger instance = this.CreateInstance();

            if (reverse.HasValue)
            {
                Assert.That(() => instance.Charge(source, reverse.Value), Throws.ArgumentException);
            }
            else
            {
                Assert.That(() => instance.Charge(source), Throws.ArgumentException);
            }
        }
コード例 #2
0
        public void Charge_SourceWithWrongLength_ReverseContentAsExpected(String source, String expected)
        {
            IBitCharger instance = this.CreateInstance();

            instance.Charge(source, true);

            Assert.That(instance.Content, Is.EqualTo(expected));
        }
コード例 #3
0
        public void Charge_SourceMatchesEightBitRestrictionButContainsInvalidCharacters_ContentAsExpected(String source, String expected)
        {
            IBitCharger instance = this.CreateInstance();

            instance.Charge(source);

            Assert.That(instance.Content, Is.EqualTo(expected));
        }
コード例 #4
0
        public void Charge_SourceContainsControlCharactersOnly_ThrowsArgumentException(String source)
        {
            IBitCharger instance = this.CreateInstance();

            Assert.That(() => instance.Charge(source), Throws.ArgumentException);
        }