Exemplo n.º 1
0
        public void PostAssignmentReturnsCreatedStatusCode()
        {
            _contextMock.Setup(m => m.Assignments).Returns(CreateSampleData(2));
            SetupControllerForTests(_controller);
            var result = _controller.Post(new Assignment {
                Id = 3, Title = "title 3"
            });

            Assert.AreEqual(HttpStatusCode.Created, result.StatusCode);
        }
Exemplo n.º 2
0
        public async void CreateAssignment()
        {
            var result = await assignmentsController.Post("1", upsertAssignment);

            Assert.True(result.Result is CreatedResult);
        }