Esempio n. 1
0
        public static void ReturnsNullPropertyValues()
        {
            var utterance = new LabeledUtterance(null, null, null);

            utterance.GetScore().Should().BeNull();
            utterance.GetTextScore().Should().BeNull();
            utterance.GetTimestamp().Should().BeNull();
        }
Esempio n. 2
0
        public static void UtteranceRoundtrip()
        {
            var utterance = new LabeledUtterance(null, null, null)
                            .WithScore(0.42)
                            .WithTextScore(0.5)
                            .WithTimestamp(DateTimeOffset.Now.Date)
                            .WithProperty("foo", new[] { 42 });
            var roundtrip = JToken.FromObject(utterance).ToObject <JsonLabeledUtterance>();

            roundtrip.GetScore().Should().BeApproximately(utterance.GetScore(), Epsilon);
            roundtrip.GetTextScore().Should().BeApproximately(utterance.GetTextScore(), Epsilon);
            roundtrip.GetTimestamp().Should().Be(utterance.GetTimestamp());
            roundtrip.GetProperty <JArray>("foo").Should().BeEquivalentTo(new[] { 42 });
        }