public static void ParsesJsonValues() { var utterance = new JsonLabeledUtterance(null, null, null); utterance.AdditionalProperties.Add("score", new JValue(0.42)); utterance.GetScore().Should().BeApproximately(0.42, Epsilon); }
public static void GetsUtteranceIdFromJson() { var utteranceId = Guid.NewGuid().ToString(); var utterance = new JsonLabeledUtterance(null, null, null); utterance.AdditionalProperties.Add("utteranceId", utteranceId); utterance.GetUtteranceId().Should().Be(utteranceId); }
public static void UsesInputUtteranceId() { var utteranceId = Guid.NewGuid().ToString(); var expectedUtterance = new JsonLabeledUtterance(null, "Greeting", null); expectedUtterance.AdditionalProperties.Add("utteranceId", utteranceId); var actualUtterance = new LabeledUtterance(null, "Greeting", null); var compareResults = TestCaseSource.GetNLUCompareResults( new[] { expectedUtterance }, new[] { actualUtterance }); compareResults.TestCases.Count.Should().Be(2); compareResults.TestCases.Where(t => t.UtteranceId == utteranceId).Count().Should().Be(2); }
public static void NoFalsePositiveIntentsUnitTestMode() { var expectedUtterance = new JsonLabeledUtterance(new JsonEntities(Array.Empty <Entity>())); var actualUtterance = new LabeledUtterance(null, "foo", null); var testSettings = new TestSettings(default(string), true); var compareResults = TestCaseSource.GetNLUCompareResults( new[] { expectedUtterance }, new[] { actualUtterance }, testSettings); compareResults.Statistics.Intent.TruePositive.Should().Be(0); compareResults.Statistics.Intent.TrueNegative.Should().Be(0); compareResults.Statistics.Intent.FalsePositive.Should().Be(0); compareResults.Statistics.Intent.FalseNegative.Should().Be(0); }