public void TestSer() { var f = new SomeTestingViewModel() { Result = "hahahaha" }; var dx = new System.Runtime.Serialization.DataContractSerializer(typeof(SomeTestingViewModel)); var s = new MemoryStream(); dx.WriteObject(s, f); s.Position = 0; var s2 = dx.ReadObject(s) as SomeTestingViewModel; Assert.AreEqual(s2.Result, f.Result); }
public async Task TestMockingViewModel() { // // TODO: Add test logic here var cm = new SomeTestingViewModel(); var tsm = cm.StageManager.DefaultStage as TestingStage; tsm.MockShowLogic <SomeTestingViewModel>(async(vm) => { var ivm = vm as IViewModel; await ivm.OnBindedViewLoad(null); await Task.Delay(200); return(vm); }); var showed = await cm.StageManager.DefaultStage.Show(cm); await Task.Delay(200); Assert.IsNotNull(cm.Result); }