Exemplo n.º 1
0
        public TestFodyVM()
        {
            TestModel = new Test()
            {
                FamilyName = "family name",
                GivenNames = "given names",
            };

            UpdateCommand = new UpdateTestCommand(this);
        }
Exemplo n.º 2
0
        public async Task <ActionResult> Update(int id, UpdateTestCommand command)
        {
            if (id != command.Id)
            {
                return(BadRequest());
            }

            await Mediator.Send(command);

            return(NoContent());
        }
Exemplo n.º 3
0
        public async Task UpdateTest(long testId, ResultStatus expectedResult)
        {
            var handler = new UpdateTestHandler(uow);
            var command = new UpdateTestCommand()
            {
                UserId = OwnerId,
                Title  = "Roberto Carlos",
                TestId = testId
            };
            var result = await handler.Handle(command, default);

            Assert.AreEqual(expectedResult, result.Status);
        }