Пример #1
0
        public void ShouldAddCommentAndReturnNewId()
        {
            AddCommentModel model = new() { Message = "TestedMessage" };

            Guid result = TestedService.Add(model);

            Assert.NotEqual(Guid.Empty, result);
        }
    }
Пример #2
0
        public void ShouldThrowArgumentNullExceptionWhenAddWithEmptyMessage()
        {
            AddCommentModel model = new() { Message = string.Empty };

            var exception =
                Record.Exception(
                    () => TestedService.Add(model)
                    );

            Assert.NotNull(exception);
            Assert.IsType <ArgumentNullException>(exception);
        }
Пример #3
0
        public void ShouldThrowArgumentNullExceptionWhenEntityIsNull()
        {
            TestedDataProviderEntity entity = null;

            Exception exception =
                Record.Exception(
                    () => TestedService.Add(entity)
                    );

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