public void GetNotFound() { var ravenDocStore = MockRepository.GenerateMock<IRavenDocStore>(); ravenDocStore.Expect(r => r.GetStore()).Return(base.DocumentStore); var service = new CoordinatorService { RavenDocStore = ravenDocStore }; var notFoundRequestId = Guid.NewGuid(); var request = new Coordinator { RequestId = notFoundRequestId }; var response = service.OnGet(request) as CoordinatorResponse; Assert.That(response.RequestId, Is.EqualTo(notFoundRequestId)); Assert.That(response.ResponseStatus.ErrorCode, Is.EqualTo("NotFound")); }
public void GetNotFound() { var ravenDocStore = MockRepository.GenerateMock <IRavenDocStore>(); ravenDocStore.Expect(r => r.GetStore()).Return(base.DocumentStore); var service = new CoordinatorService { RavenDocStore = ravenDocStore }; var notFoundRequestId = Guid.NewGuid(); var request = new Coordinator { RequestId = notFoundRequestId }; var response = service.OnGet(request) as CoordinatorResponse; Assert.That(response.RequestId, Is.EqualTo(notFoundRequestId)); Assert.That(response.ResponseStatus.ErrorCode, Is.EqualTo("NotFound")); }
public void GetFound() { var ravenDocStore = MockRepository.GenerateMock<IRavenDocStore>(); ravenDocStore.Expect(r => r.GetStore()).Return(base.DocumentStore); var service = new CoordinatorService {RavenDocStore = ravenDocStore}; var request = new Coordinator { RequestId = _coordinatorId }; var response = service.OnGet(request) as CoordinatorResponse; Assert.That(response.RequestId, Is.EqualTo(_coordinatorId)); Assert.That(response.Messages.Count, Is.EqualTo(2)); Assert.That(response.Messages[0].Number, Is.EqualTo("12313")); Assert.That(response.Messages[0].Status, Is.EqualTo(MessageStatusTracking.CompletedSuccess)); Assert.That(response.Messages[1].Number, Is.EqualTo("434039")); Assert.That(response.Messages[1].Status, Is.EqualTo(MessageStatusTracking.Scheduled)); ravenDocStore.VerifyAllExpectations(); }
public void GetFound() { var ravenDocStore = MockRepository.GenerateMock <IRavenDocStore>(); ravenDocStore.Expect(r => r.GetStore()).Return(base.DocumentStore); var service = new CoordinatorService { RavenDocStore = ravenDocStore }; var request = new Coordinator { RequestId = _coordinatorId }; var response = service.OnGet(request) as CoordinatorResponse; Assert.That(response.RequestId, Is.EqualTo(_coordinatorId)); Assert.That(response.Messages.Count, Is.EqualTo(2)); Assert.That(response.Messages[0].Number, Is.EqualTo("12313")); Assert.That(response.Messages[0].Status, Is.EqualTo(MessageStatusTracking.CompletedSuccess)); Assert.That(response.Messages[1].Number, Is.EqualTo("434039")); Assert.That(response.Messages[1].Status, Is.EqualTo(MessageStatusTracking.Scheduled)); ravenDocStore.VerifyAllExpectations(); }