Ejemplo n.º 1
0
        public async Task <Unit> Handle(IncubationRequest request, CancellationToken cancellationToken)
        {
            var incubator = _incubatorFactory.Build();

            await incubator.Incubate(request);

            return(Unit.Value);
        }
Ejemplo n.º 2
0
        public void should_start_the_incubator()
        {
            var request = new IncubationRequest("Warrior", 5);

            var incubator = Substitute.For <IIncubator>();

            _incubatorFactory.Build().Returns(incubator);

            _handler.Handle(request, new CancellationToken());

            _incubatorFactory.Received(1).Build();
            incubator.Received(1).Incubate(Arg.Is <IncubationRequest>(it => it.Type == "Warrior" && it.Quantity == 5));
        }
Ejemplo n.º 3
0
        public void should_build_an_incubator()
        {
            var incubator = _factory.Build();

            Assert.True(incubator is IIncubator);
        }
Ejemplo n.º 4
0
 public DefaultEggsChecker(IIncubatorFactory incubatorFactory)
 {
     _incubator = incubatorFactory.Build();
 }
Ejemplo n.º 5
0
 public IIncubator BuildIncubator()
 {
     return(_incubatorFactory.Build());
 }