void before_each() { _channelMock = new EnqueuerMock(); _subject = new HasGameReachedTerminalCondition(_channelMock); _subject.Consume(new GameInitiated { grid = new BuildGridOfSize(GridSize).Build() }); }
public async Task WhenPostThenEnqueueFileToProcess() { var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/api1/otfs"); var content = GetAsStrem("[BOF]" + Environment.NewLine); request.Content = new StreamContent(content); request.Content.Headers.ContentType = new MediaTypeHeaderValue("text/plain"); request.Content.Headers.ContentLength = content.Length; var enqueuer = new EnqueuerMock <StationFileToProcess>(); OtfsController controller = new OtfsController(new NoOpStationFileStore("centenario/piiza.txt"), enqueuer); controller.Request = request; controller.Configuration = new HttpConfiguration(); await controller.Post("Centenario"); var actual = enqueuer.Messages.First(); actual.FilePath.Should().Be("centenario/piiza.txt"); actual.StationId.Should().Be("Centenario"); actual.RecivedAt.Should().Not.Be(DateTimeOffset.MinValue); }