private static TestCase CreateTestCase( string utteranceId, ConfusionMatrixResultKind resultKind, ComparisonTargetKind targetKind, ILabeledUtterance expectedUtterance, ILabeledUtterance actualUtterance, double?score, string group, string[] args, string because, IEnumerable <string> categories) { var categoriesWithGroup = categories; if (group != null) { categoriesWithGroup.Append(group); } return(new TestCase( utteranceId, resultKind, targetKind, expectedUtterance, actualUtterance, score, group, $"{resultKind}{targetKind}('{string.Join("', '", args)}')", because, categoriesWithGroup)); }
private static TestCase FalseNegative( ComparisonTargetKind targetKind, LabeledUtterance expectedUtterance, LabeledUtterance actualUtterance, double score, string group, string[] args, string because, params string[] categories) { return(CreateTestCase( ConfusionMatrixResultKind.FalseNegative, targetKind, expectedUtterance, actualUtterance, score, group, args, because, categories.Append("FalseNegative"))); }
/// <summary> /// Initializes a new instance of the <see cref="TestCase"/> class. /// </summary> /// <param name="resultKind">Confusion matrix result kind.</param> /// <param name="targetKind">Comparison target kind.</param> /// <param name="expectedUtterance">Expected utterance.</param> /// <param name="actualUtterance">Actual utterance.</param> /// <param name="score">Confidence score for test case result.</param> /// <param name="group">Test case group name.</param> /// <param name="testName">Test name.</param> /// <param name="because">Because.</param> /// <param name="categories">Categories.</param> public TestCase( ConfusionMatrixResultKind resultKind, ComparisonTargetKind targetKind, LabeledUtterance expectedUtterance, LabeledUtterance actualUtterance, double score, string group, string testName, string because, IEnumerable <string> categories) { this.ResultKind = resultKind; this.TargetKind = targetKind; this.ExpectedUtterance = expectedUtterance; this.ActualUtterance = actualUtterance; this.Score = score; this.Group = group; this.TestName = testName; this.Because = because; this.Categories = categories.ToList(); }
private static TestCase TruePositive( string utteranceId, ComparisonTargetKind targetKind, ILabeledUtterance expectedUtterance, ILabeledUtterance actualUtterance, double?score, string group, string[] args, string because, params string[] categories) { return(CreateTestCase( utteranceId, ConfusionMatrixResultKind.TruePositive, targetKind, expectedUtterance, actualUtterance, score, group, args, because, categories.Append("TruePositive"))); }