コード例 #1
0
        public void CreateEvent_SendICommandHandlerWithCreateRouteCommand(
            [Frozen] ICommandHandler <CreateRouteCommand> createRouteCommandHandler,
            [Frozen] IEventRepository eventRepository,
            [Frozen] IEventFactory eventFactory,
            CreateEventCommand message,
            Event @event,
            CreateEventCommandHandler createEventCommandHandler)
        {
            //Information
            A.CallTo(() => eventFactory.Create(message.Event)).Returns(@event);
            A.CallTo(() => eventRepository.Add(@event));

            //Act
            createEventCommandHandler.ExecuteAsync(message);

            //Test
            A.CallTo(() => createRouteCommandHandler.ExecuteAsync(A <CreateRouteCommand> .Ignored))
            .MustHaveHappened();
        }
コード例 #2
0
 public CreateEventCommandTests() : base()
 {
     _sut = new CreateEventCommandHandler(_context, new DateTimeTestProvider());
 }
コード例 #3
0
 public CreateEventCommandHandlerTests()
 {
     _eventRepository = Substitute.For <IEventRepository>();
     _unitOfWork      = Substitute.For <IUnitOfWork>();
     _handler         = new CreateEventCommandHandler(_eventRepository, _unitOfWork);
 }