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)); }
public void Test_MemberRoute_Serialize() { MemberRoute route = BasicRoute1; var output = SerializeAndPrint(route); Assert.That(output != null && output.Length > 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); }