Exemplo n.º 1
0
        public async Task Post_ShouldInsertIdea()
        {
            var idea = new IdeaModel
            {
                content    = "My idea",
                impact     = 6,
                ease       = 7,
                confidence = 8
            };

            // Arrange
            Functions.AddMockIdentityToContext(_ideasController, "*****@*****.**");

            // Act
            var result = await _ideasController.Post(idea);

            // Assert
            Assert.NotNull(result);

            var createdResult = result as CreatedResult;

            Assert.NotNull(createdResult);
            Assert.Equal(201, createdResult.StatusCode);
        }