public async Task AddPatternShouldAddPattern()
        {
            var pattern = new Pattern();

            _projectBLMock.Setup(x => x.AddPatternAsync(It.IsAny <Pattern>())).Returns(Task.FromResult <Pattern>(pattern));
            var patternController = new PatternController(_projectBLMock.Object);
            var result            = await patternController.AddPatternAsync(new Pattern());

            Assert.IsAssignableFrom <CreatedAtActionResult>(result);
            _projectBLMock.Verify(x => x.AddPatternAsync((It.IsAny <Pattern>())));
        }
        public async Task AddPatternAsync_ShouldReturnStatusCode400_WhenPatternIsInvalid()
        {
            //arrange
            Pattern pattern = null;

            _projectBLMock.Setup(i => i.AddPatternAsync(pattern)).Throws(new Exception());
            PatternController patternController = new PatternController(_projectBLMock.Object);

            //act
            var result = await patternController.AddPatternAsync(pattern);

            //assert
            Assert.IsType <StatusCodeResult>(result);
            Assert.Equal(400, ((StatusCodeResult)result).StatusCode);
        }