public void ShouldReturnErrorResolutionIfException() { var workItem = new VSTSWorkItem { Fields = new Dictionary <string, string>() }; workItem.Fields.Add(VSTSFieldNames.WorkItemType, ExceptionWorkItemClassifier.SupportedType); workItem.Updates = UpdateBuilder.Create().Resolved() .Build(); var classifier = new ExceptionWorkItemClassifier(); var result = classifier.Classify(new WorkItemResolutionRequest { WorkItem = workItem }); result.Should().NotBeNull(); result.IsError.Should().BeTrue(); result.Reason.Should().Be(ExceptionWorkItemClassifier.ExpectedReason); }
public void ShouldReturnErrorResolutionIfException() { var workItem = Builder <WorkItemViewModel> .CreateNew() .With(w => w.Fields, new Dictionary <string, string>()) .Build(); workItem.Fields.Add(Constants.WorkItemTypeField, ExceptionWorkItemClassifier.SupportedType); workItem.Updates = UpdateBuilder.Create().Resolved() .Build(); var classifier = new ExceptionWorkItemClassifier(); var result = classifier.Classify(new WorkItemResolutionRequest { WorkItem = workItem }); result.Should().NotBeEmpty(); result.Should().OnlyContain(r => r is ErrorClassifyingWorkItemEvent); result.Should().OnlyContain(r => ((ErrorClassifyingWorkItemEvent)r).Error.Message == ExceptionWorkItemClassifier.ExpectedReason); }