public void AddToProcessed_when_exception() { //arrange IJobContext context = new JobContext(Helper.GetJobId()); //assert Assert.NotNull(context.ParentJobId); Assert.Throws <ArgumentNullException>(() => context.AddToProcessed(null)); }
public void AddToProcessed() { //arrange IJobContext context = new JobContext(Helper.GetJobId()); //act var id1 = Helper.GetJobId(); var id2 = Helper.GetJobId(); var id3 = Helper.GetJobId(); context.AddToProcessed(id1); context.AddToProcessed(id2); context.AddToProcessed(id3); //assert Assert.NotNull(context.ParentJobId); Assert.NotEmpty(context.ProcessedJobs); Assert.True(context.ProcessedJobs.Count == 3); Assert.All(context.ProcessedJobs, job => job.Name.Equals(id1.Name)); }