public void ShouldReturnValidWhenDeleteCommandIsValid() { var command = new DeleteClassRoomCommand(); command.Id = Guid.NewGuid(); var handler = new ClassRoomHandler(new ClassRoomRepositoryMock()); var result = handler.Handle(command); Assert.AreEqual(true, result.Status); }
public void ShouldReturnValidWhenCreateCommandIsValid() { var command = new CreateClassRoomCommand(); command.Description = "ClassRoom 1"; command.Status = EClassRoomStatus.Free; command.Type = EClassRoomType.Normal; command.IdBlock = Guid.NewGuid(); var handler = new ClassRoomHandler(new ClassRoomRepositoryMock()); var result = handler.Handle(command); Assert.AreEqual(true, result.Status); }
public ICommandResult Post([FromBody] CreateClassRoomCommand command) { return(_handler.Handle(command)); }