public Response Start() { Theory theory = this.theoryService.NextTheory(false, false, false); ResponseType responseType = witness.Reply(theory); while (responseType != ResponseType.Right) { if (responseType == ResponseType.Suspect) WhoSuspect(responseType, ResponseType.Suspect, this.theoryService, witness, theory); if (responseType == ResponseType.Local) WhoLocal(responseType, ResponseType.Local, this.theoryService, witness, theory); if (responseType == ResponseType.Gun) WhoGun(responseType, ResponseType.Gun, this.theoryService, witness, theory); responseType = witness.Reply(theory); } Response response = new Response() { Gun = theory.Gun, Local = theory.Local, Suspect = theory.Suspect, }; return response; }
public void Obter_Resposta_Arma_4_Local_6_Suspeito_6() { // Arrange Response respostaEsperada = new Response() { Gun = "Arma 4", Local = "Local 6", Suspect = "Suspeito 6" }; Witness testemunha = new Witness(respostaEsperada); // Act InterrogationService servicoDeInterrogacao = new InterrogationService(testemunha, this.caso); Response respostaRetornada = servicoDeInterrogacao.Start(); // Assert Assert.AreEqual<string>(respostaEsperada.Suspect, respostaRetornada.Suspect); Assert.AreEqual<string>(respostaEsperada.Local, respostaRetornada.Local); Assert.AreEqual<string>(respostaEsperada.Gun, respostaRetornada.Gun); }
public Witness(Response response) { this.response = response; }
private void VerificaResposta(Response respostaDoCaso, Response respostaEsperada) { Assert.AreEqual<string>(respostaEsperada.Suspect, respostaDoCaso.Suspect); Assert.AreEqual<string>(respostaEsperada.Local, respostaDoCaso.Local); Assert.AreEqual<string>(respostaEsperada.Gun, respostaDoCaso.Gun); }