Ejemplo n.º 1
0
        public void GetMetaValues__Given_Model__When_NullValues__Then_ReturnNonNullMetaValues
            (string expectedMeta1, long expectedMeta3)
        {
            var subject = CreateSubject(typeof(TestGetModelMetaValues));

            var model = new TestGetModelMetaValues
            {
                Meta1 = expectedMeta1,
                Meta3 = expectedMeta3
            };

            var result = subject.GetMetaValues(model);

            Assert.Equal(expectedMeta1, result["meta1"].ToObject <string>());
            Assert.Equal(JTokenType.Null, result["meta-2"].Type);
            Assert.Equal(expectedMeta3, result["meta3"].ToObject <long>());
        }
Ejemplo n.º 2
0
        public void GetMetaValues__Given_Model__Then_ReturnAllMetaValues
            (string expectedMeta1, int expectedMeta2, long expectedMeta3)
        {
            var subject = CreateSubject(typeof(TestGetModelMetaValues));

            var model = new TestGetModelMetaValues
            {
                Meta1 = expectedMeta1,
                Meta2 = expectedMeta2,
                Meta3 = expectedMeta3
            };

            var result = subject.GetMetaValues(model);

            Assert.Equal(expectedMeta1, result["meta1"].ToObject <string>());
            Assert.Equal(expectedMeta2, result["meta-2"].ToObject <int>());
            Assert.Equal(expectedMeta3, result["meta3"].ToObject <long>());
        }