コード例 #1
0
        public void ShouldThrowArgumentNullExceptionWhenCommentIdIsDefaultInIncrement()
        {
            Guid testedCommentId = default;

            Action testedAction = () => TestedService.Increment(testedCommentId);

            ShouldThrowArgumentNullExceptionWhenCommentIdIsDefaultInternal(testedAction);
        }
コード例 #2
0
        public void ShouldThrowEntityNotFoundExceptionWhenEntityNotFoundByIdInIncrement()
        {
            Guid   testedCommentId      = Guid.NewGuid();
            string expectedErrorMessage = $"Entity \"Comment\" - \"{testedCommentId}\" not found.";

            Action testedAction = () => TestedService.Increment(testedCommentId);

            ShouldThrowEntityNotFoundExceptionWhenEntityNotFoundByIdInternal(testedAction, expectedErrorMessage);
        }
コード例 #3
0
        public void ShouldIncrementCommentAppearanceCount()
        {
            Guid   testedCommentId     = Guid.NewGuid();
            string expectedCommandName = "Update";
            long   newAppearanceCount  = ReturnedTestedComment.AppearanceCount + 1;
            IDictionary <string, object> secondExpectedArgument = new Dictionary <string, object> {
                { "AppearanceCount", newAppearanceCount }
            };

            Action testedAction = () => TestedService.Increment(testedCommentId);

            ShouldExecuteCommand(testedAction, expectedCommandName, new object[] { testedCommentId, secondExpectedArgument });
        }