Example #1
0
        public static void TestToIntentTestCaseActualNoneExpectingDayTime()
        {
            var actual     = "None";
            var expected   = "Daytime";
            var utterances = CreatePair(new[]
            {
                new LabeledUtterance("FOO", expected, null),
                new LabeledUtterance("FOO", actual, null)
            });

            var tests = TestCaseSource.ToIntentTestCases(utterances);

            var testList = tests.ToList();

            tests.Count().Should().Be(2);
            var actualFalsePositive = tests.FirstOrDefault(t => t.ResultKind == ConfusionMatrixResultKind.FalsePositive);
            var actualFalseNegative = tests.FirstOrDefault(t => t.ResultKind == ConfusionMatrixResultKind.FalseNegative);

            actualFalsePositive.Should().NotBeNull();
            actualFalsePositive.TestName.Should().MatchRegex(FalsePositiveIntentRegex);
            actualFalsePositive.Group.Should().Be(actual);
            actualFalseNegative.Should().NotBeNull();
            actualFalseNegative.TestName.Should().MatchRegex(FalseNegativeIntentRegex);
            actualFalseNegative.Group.Should().Be(expected);
        }
Example #2
0
        public static void TestToIntentTestCaseActualNoneExpectingDayTime()
        {
            var utterances = CreatePair(new[]
            {
                new LabeledUtterance("FOO", "DayTime", null),
                new LabeledUtterance("FOO", "None", null)
            });

            var tests = TestCaseSource.ToIntentTestCases(utterances);

            tests.Count().Should().Be(1);
            tests.Single().TestName.Should().MatchRegex(FalseNegativeIntentRegex);
            tests.Single().ResultKind.Should().Be(ConfusionMatrixResultKind.FalseNegative);
        }