public void Setup() { _systemClock = MockRepository.GenerateStub<ISystemClock>(); _logger = new MockLogger(); _messagingService = new MessagingService(_logger); _supportCase = new SupportCase("Looking at the logs", _systemClock); }
public void Should_not_notify_management_when_case_is_not_escalated() { SupportCase = SupportCaseProcessor.InitiateSupportCase("Make the corners rounded."); SupportCaseProcessor.Process(SupportCase); MessagingService.AssertWasNotCalled(m => m.EscalateToManagement(Arg<SupportCase>.Is.Anything)); }
public void Setup() { _systemClock = MockRepository.GenerateStub<ISystemClock>(); _logger = MockRepository.GenerateMock<ILogger>(); //a Mock, because it's key to the test assertions _messagingService = new MessagingService(_logger); _supportCase = new SupportCase("Interacting with the logger", _systemClock); }
public override void Process(SupportCase supportCase) { _messagingService.RespondToClient(supportCase); if (supportCase.IsEscalated) { _messagingService.EscalateToManagement(supportCase); } }
public override void Process(SupportCase supportCase) { _messagingService.RespondToClient(supportCase); if (supportCase.IsEscalated) { _messagingService.EscalateToManagement(supportCase); } }
public void Should_notify_management_when_case_is_escalated() { SupportCase = SupportCaseProcessor.InitiateSupportCase("Make the corners rounded."); SupportCase.IsEscalated = true; SupportCaseProcessor.Process(SupportCase); MessagingService.AssertWasCalled(m => m.EscalateToManagement(SupportCase)); }
public void WriteToLog(SupportCase supportCase) { _logger.WriteCase( new CaseLog { IsFinalized = supportCase.IsFinalized, DateFinalized = supportCase.DateFinalized, Description = supportCase.Description, FinalizeMessage = supportCase.FinalizeMessage, Finalizer = supportCase.Finalizer, IsEscalated = supportCase.IsEscalated }); }
public void WriteToLog(SupportCase supportCase) { _logger.WriteCase( new CaseLog { IsFinalized = supportCase.IsFinalized, DateFinalized = supportCase.DateFinalized, Description = supportCase.Description, FinalizeMessage = supportCase.FinalizeMessage, Finalizer = supportCase.Finalizer, IsEscalated = supportCase.IsEscalated }); }
public override void MarkAsClosed(SupportCase supportCase, string finalizer, string finalizeMessage) { if (!_verifier.IsResolved(supportCase)) { throw new ApplicationException("Case has not been verified as resolved."); } if (supportCase.IsFinalized) { return; } supportCase.Finalize(finalizer, finalizeMessage); _messagingService.RespondToClient(supportCase); _messagingService.WriteToLog(supportCase); }
public override void MarkAsClosed(SupportCase supportCase, string finalizer, string finalizeMessage) { if (!_verifier.IsResolved(supportCase)) { throw new ApplicationException("Case has not been verified as resolved."); } if (supportCase.IsFinalized) { return; } supportCase.Finalize(finalizer, finalizeMessage); _messagingService.RespondToClient(supportCase); _messagingService.WriteToLog(supportCase); }
public void RespondToClient(SupportCase supportCase) { throw new NotImplementedException(); }
public abstract void MarkAsClosed(SupportCase supportCase, string finalizer, string finalizeMessage);
public void EscalateToManagement(SupportCase supportCase) { throw new NotImplementedException(); }
public void RespondToClient(SupportCase supportCase) { throw new NotImplementedException(); }
public abstract void MarkAsClosed(SupportCase supportCase, string finalizer, string finalizeMessage);
public void EscalateToManagement(SupportCase supportCase) { throw new NotImplementedException(); }
public abstract void Process(SupportCase supportCase);
public abstract void Process(SupportCase supportCase);