Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Test]
- public async Task Send_Document_Replaces_jobTitle([ValueSource(nameof(StringTestCases))] string jobName) {
- var ippMessage = GetSampleIppMessage();
- ippMessage.OperationAttributes.Attributes.Add(GetJobNameAttribute(jobName));
- ippMessage.OperationId = OperationId.CreateJob;
- FakeContextRequestStream(ippMessage);
- A.CallTo(() => ippHandler.HandleIpp(A<IIppMessage>.Ignored)).Returns(GetResponseMessage(ippMessage));
- await testedService.HandleIppMessage(fakeContext);
- var title = "THIS IS NEW TiTLE!!!";
- var ippMessage2 = GetSampleIppMessage();
- ippMessage2.OperationAttributes.Attributes.Add(GetJobNameAttribute(title));
- ippMessage2.OperationId = OperationId.SendDocument;
- FakeContextRequestStream(ippMessage2);
- await testedService.HandleIppMessage(fakeContext);
- A.CallTo(() => jobInfoRepository.Store(A<int>._, A<JobInfo>.That.Matches(jobInfo => jobInfo.Title.Equals(jobName))))
- .MustHaveHappened(Repeated.Exactly.Once)
- .Then(A.CallTo(() => jobInfoRepository.Store(A<int>._, A<JobInfo>.That.Matches(jobInfo => jobInfo.Title.Equals(title))))
- .MustHaveHappened(Repeated.Exactly.Once));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement