public void EndScenario_Without_BeginScenario_Responds_With_Yikes() { var endRequest = new EndScenarioRequest(); var response = processor.Process(endRequest); response.Should().Be.InstanceOf<YikesResponse>(); }
public void BeginScenario_Then_EndScenario_Responds_With_Success() { var beginRequest = new BeginScenarioRequest(); var endRequest = new EndScenarioRequest(); processor.Process(beginRequest); var response = processor.Process(endRequest); response.Should().Be.InstanceOf<SuccessResponse>(); }
private Response ProcessEndScenario(EndScenarioRequest request) { if (scenarioInProgress) { scenarioInProgress = false; var serializer = new JsonSerializer(); var tags = (request.Tags == null) ? null : request.Tags.Select(t => serializer.Deserialize<string>(new JTokenReader(t))).ToArray(); OnAfterScenario(tags); return new SuccessResponse(); } else { return new YikesResponse(); } }