public void ITestDataModelCreateObject() { ITestDataModel dataModel = new TestDataModel("NoName", 34); dataModel.Update(); Assert.IsTrue(dataModel.Count == 35); dataModel.Save(new TestDataModel("SimpleName", 24)); Assert.IsTrue(dataModel.Name == "SimpleName" && dataModel.Count == 24); }
public void UpdateTestWhenDataModelGetNewStateWithUpdate() { int oldCount = 34; ITestDataModel dataModel = new TestDataModel("NoName", oldCount); IItemModel <ITestDataModel> model = new ItemModel <ITestDataModel>(dataModel); int newCount = 0; model.Updated += (sender, e) => { newCount = e.Item.DataModel.Count; }; model.Update(); Assert.IsTrue(newCount == oldCount + 1); }