public void Model_GetModelSameTypeTestCase() { CreateObjectViewModel firstViewModel = null; CreateObjectModel firstModel = null; CreateObjectModel secondModel = null; Given("Create view-model", frame => firstViewModel = ViewModelBase.CreateViewModel <CreateObjectViewModel>(frame)) .When("Get models", _ => { firstModel = firstViewModel.GetModel <CreateObjectModel>(); secondModel = firstModel.GetModel <CreateObjectModel>(); }) .Then("Cheking models", _ => { firstViewModel.NotNull().CheckCreateObject(4); Assert.AreNotEqual(firstModel, secondModel, "must be different objects"); }) .RunWindow(Timeuots.Second.Five); }
public void Model_GetModelTestCase() { CreateObjectViewModel firstViewModel = null; CreateObjectModel firstModel = null; TestModel secondModel = null; Given("Create view-model", frame => firstViewModel = ViewModelBase.CreateViewModel <CreateObjectViewModel>(frame)) .When("Get models", _ => { firstModel = firstViewModel.GetModel <CreateObjectModel>(); secondModel = firstModel.GetModel <TestModel>(); }) .Then("Cheking models", _ => { firstViewModel.NotNull().CheckCreateObject(4); Assert.IsNotNull(firstModel, "first model can not be null"); Assert.IsNotNull(secondModel, "first model can not be null"); Assert.AreEqual(1, firstModel.GetModelCallCounter, $"method '{nameof(ModelBase.GetModel)}' should be called 1 times"); }) .RunWindow(Timeuots.Second.Five); }