Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 public ICommandResult Post([FromBody] CreateClassRoomCommand command)
 {
     return(_handler.Handle(command));
 }