Esempio n. 1
0
        public void ShouldFailLowerCaseAssertionOnUpperCaseCharAndPassOnLowerCaseChar()
        {
            var c = Any.AlphaChar();

            Assert.Throws <AssertionException>(() => XAssert.IsLowerCase(char.ToUpper(c)));
            Assert.DoesNotThrow(() => XAssert.IsLowerCase(char.ToLower(c)));
        }
Esempio n. 2
0
        public void ShouldBeAbleToGenerateDistinctLettersEachTime()
        {
            //WHEN
            var char1 = Any.AlphaChar();
            var char2 = Any.AlphaChar();
            var char3 = Any.AlphaChar();

            //THEN
            Assert.Multiple(() =>
            {
                Assert.AreNotEqual(char1, char2);
                Assert.AreNotEqual(char2, char3);
                Assert.True(Char.IsLetter(char1));
                Assert.True(Char.IsLetter(char2));
                Assert.True(Char.IsLetter(char3));
            });
        }
Esempio n. 3
0
        public void ShouldBeAbleToGenerateDistinctLettersEachTime()
        {
            //WHEN
            var char1 = Any.AlphaChar();
            var char2 = Any.AlphaChar();
            var char3 = Any.AlphaChar();

            //THEN
            XAssert.All(assert =>
            {
                assert.NotEqual(char1, char2);
                assert.NotEqual(char2, char3);
                assert.True(Char.IsLetter(char1));
                assert.True(Char.IsLetter(char2));
                assert.True(Char.IsLetter(char3));
            });
        }