public async Task Should_update_a_coffee_place() { var command = new UpdateEventRoomCommandBuilder() .Build(); var eventRoom = new EventRoomBuilder() .WithId(command.EventRoomId) .Build(); _eventRoomRepository .GetByIdAsync(command.EventRoomId) .Returns(eventRoom); var response = await _eventRoomService .Update(command); response .Id .Should() .Be(command.EventRoomId); response .Name .Should() .Be(command.Name); response .Capacity .Should() .Be(command.Capacity); response .PersonEventRoomAssociations .Should() .BeEmpty(); }
public void Should_not_update_a_event_room_if_they_are_not_found() { var command = new UpdateEventRoomCommandBuilder() .Build(); _eventRoomRepository .GetByIdAsync(command.EventRoomId) .ReturnsNull(); Action act = () => _eventRoomService .Update(command) .GetAwaiter() .GetResult(); act .Should() .Throw <NotFoundException>() .Where(w => w.Message == "Sala de Evento não encontrada"); }