public void NavigationPushPopSerializationTest() { var engine = new DictionaryStorageEngine(); using (var _ = engine.AsPrimaryEngine()) { var input = new TestViewModel() { SomeProp = "Foo" }; var fixture = new RoutingState(); fixture.NavigateForward.Execute(input); RxStorage.Engine.CreateSyncPoint(fixture); var output = RxStorage.Engine.GetLatestRootObject <RoutingState>(); Assert.True(output.NavigateBack.CanExecute(null)); output.NavigateBack.Execute(null); RxStorage.Engine.CreateSyncPoint(output); output = RxStorage.Engine.GetLatestRootObject <RoutingState>(); Assert.False(output.NavigateBack.CanExecute(null)); } }
public void RoutingStateSerializableRoundTripTest() { var engine = new DictionaryStorageEngine(); using(var _ = engine.AsPrimaryEngine()) { var input = new TestViewModel() {SomeProp = "Foo"}; var fixture = new RoutingState(); fixture.NavigationStack.Add(input); RxStorage.Engine.CreateSyncPoint(fixture); var output = RxStorage.Engine.Load<RoutingState>(fixture.ContentHash); Assert.True(output.NavigationStack.Count == 1); Assert.True(output.NavigationStack[0].ContentHash == input.ContentHash); Assert.Equal(input.SomeProp, ((TestViewModel) output.NavigationStack[0]).SomeProp); } }
public void RoutingStateSerializableRoundTripTest() { var engine = new DictionaryStorageEngine(); using (var _ = engine.AsPrimaryEngine()) { var input = new TestViewModel() { SomeProp = "Foo" }; var fixture = new RoutingState(); fixture.NavigationStack.Add(input); RxStorage.Engine.CreateSyncPoint(fixture); var output = RxStorage.Engine.Load <RoutingState>(fixture.ContentHash); Assert.True(output.NavigationStack.Count == 1); Assert.True(output.NavigationStack[0].ContentHash == input.ContentHash); Assert.Equal(input.SomeProp, ((TestViewModel)output.NavigationStack[0]).SomeProp); } }
public void NavigationPushPopSerializationTest() { var engine = new DictionaryStorageEngine(); using (var _ = engine.AsPrimaryEngine()) { var input = new TestViewModel() {SomeProp = "Foo"}; var fixture = new RoutingState(); fixture.NavigateForward.Execute(input); RxStorage.Engine.CreateSyncPoint(fixture); var output = RxStorage.Engine.GetLatestRootObject<RoutingState>(); Assert.True(output.NavigateBack.CanExecute(null)); output.NavigateBack.Execute(null); RxStorage.Engine.CreateSyncPoint(output); output = RxStorage.Engine.GetLatestRootObject<RoutingState>(); Assert.False(output.NavigateBack.CanExecute(null)); } }