Пример #1
0
        public void Test_MemberRoute_Full()
        {
            MemberRoute route     = new MemberRoute(MemberContext.StaticMainMemberContext, "raining");
            var         sameRoute = JsonConvert.DeserializeObject <MemberRoute>(JsonConvert.SerializeObject(route));

            Assert.That(sameRoute, Is.EqualTo(route));
        }
Пример #2
0
        public void Test_MemberRoute_Serialize()
        {
            MemberRoute route = BasicRoute1;

            var output = SerializeAndPrint(route);

            Assert.That(output != null && output.Length > 0);
        }
Пример #3
0
        public void Test_MemberRoute_Deserialize()
        {
            string input = @"{
  'Context': {
    'ContextType': 'Main',
    'ContextKey': null
  },
  'AccessorKey': 'raining',
  'Instance': false
}";

            MemberRoute route = JsonConvert.DeserializeObject <MemberRoute>(input);

            Assert.That(route.Context.ContextType == MemberContextType.Main);
            Assert.That(route.Context.ResolvedContext == null);
            Assert.That(route.Context.Static);
            Assert.That(route.AccessorKey == "raining");
            Assert.That(!route.Instance);
        }