Ejemplo n.º 1
0
        public void ShouldDeleteComments()
        {
            Guid[] commentIds          = new[] { Guid.NewGuid() };
            string expectedCommandName = "Delete";

            Action testedAction = () => TestedService.Delete(commentIds);

            ShouldExecuteCommand(testedAction, expectedCommandName, new object[] { commentIds });
        }
Ejemplo n.º 2
0
        public void ShouldNotDeleteCommentsWhenCommentIdsContainsOnlyGuidEmptyValues()
        {
            Guid[] commentIds = new[] { Guid.Empty };
            TestedService.Delete(commentIds);

            KeyValuePair <string, IEnumerable <object> >?lastCommand = LastCommand;

            Assert.Null(lastCommand);
        }
Ejemplo n.º 3
0
        public void ShouldThrowArgumentNullExceptionWhenArgumentIsNull()
        {
            Guid[] entityIds = null;

            Exception exception =
                Record.Exception(
                    () => TestedService.Delete(entityIds)
                    );

            Assert.NotNull(exception);
            Assert.IsType <ArgumentNullException>(exception);
        }
Ejemplo n.º 4
0
        public void ShouldThrowArgumentNullExceptionWhenParameterIsNull()
        {
            Guid[] commentIds = null;

            var exception =
                Record.Exception(
                    () => TestedService.Delete(commentIds)
                    );

            Assert.NotNull(exception);
            Assert.IsType <ArgumentNullException>(exception);
        }