コード例 #1
0
        public void IdentifierCanParseToNumber()
        {
            var knownSentence = "8 mad orcs stomp loudly";

            int parsedId = IdentifierSentence.Parse(knownSentence);

            parsedId.Should().Be(23569896);
        }
コード例 #2
0
        public void IdentifierCanGenerateRandomSentence()
        {
            var    randomSentence = IdentifierSentence.Random();
            Action parsingAction  = () => IdentifierSentence.Parse(randomSentence);

            randomSentence.Should().NotBeNullOrEmpty();
            parsingAction.Should().NotThrow();
        }
コード例 #3
0
        public void ShouldThrowExceptionWithBadSentence()
        {
            var    badSentence   = "Something Bad Here";
            Action parsingAction = () => IdentifierSentence.Parse(badSentence);

            parsingAction.Should()
            .Throw <Exception>()
            .WithMessage("Bad identifier sentence provided.");
        }