Exemplo n.º 1
0
        public void ShouldHaveTwoJobProgressesWhenTwoWithSameGuidAreAdded()
        {
            Target = new JobDetailSender(_nodeConfiguration, _httpSenderFake);

            var jobid = Guid.NewGuid();

            Target.AddDetail(jobid, "Progress message 1.");
            Target.AddDetail(jobid, "Progress message 2.");
            Assert.IsTrue(Target.DetailsCount() == 2);
        }
Exemplo n.º 2
0
        public void ShouldSendAllDetailsInTheSameRequest()
        {
            Target = new JobDetailSender(_nodeConfiguration, _httpSenderFake);

            var jobid = Guid.NewGuid();

            Target.AddDetail(jobid, "Progress message 1.");
            Target.AddDetail(jobid, "Progress message 2.");

            Target.Send(CancellationToken.None);
            _httpSenderFake.SentJson.Should().Contain("Progress message 1.");
            _httpSenderFake.SentJson.Should().Contain("Progress message 2.");
        }
Exemplo n.º 3
0
 public void ShouldRemoveDetailWhenSent()
 {
     Target = new JobDetailSender(_nodeConfiguration, _httpSenderFake);
     Target.AddDetail(Guid.NewGuid(), "Progress message.");
     Target.Send(CancellationToken.None);
     Target.DetailsCount().Should().Be.EqualTo(0);
 }
Exemplo n.º 4
0
 public void ShouldBeAbleToAddDetail()
 {
     Target = new JobDetailSender(_nodeConfiguration, _httpSenderFake);
     Target.AddDetail(Guid.NewGuid(), "Progress message");
     Assert.IsTrue(Target.DetailsCount() == 1);
 }