Test Objects |
This topic contains the following sections:
A example of a simple SOWI Test App
/// <summary> /// A simple SOWI App controller based on <see cref="SOWIApp.Foundation.IAppController{DataItemClass}"/> /// </summary> public class SOWIAppController : SOWIApp.Foundation.IAppController<TestObject.Models.SOWIDataTestModel> { /// <summary> /// Constructor without parameter /// </summary> public SOWIAppController() { } public List<SOWIData.Management.DataGrid> DataGridView { get { return new List<SOWIData.Management.DataGrid>(); } } public void Delete(int pID) { throw new NotImplementedException(); } public TestObject.Models.SOWIDataTestModel GetByID(int pID) { return new TestObject.Models.SOWIDataTestModel(); } public List<TestObject.Models.SOWIDataTestModel> GetView(ref SOWIData.Management.ListViewConfig pViewConfig, Dictionary<string, string> pDictionaryUI = null) { return new List<TestObject.Models.SOWIDataTestModel>(); } public List<TestObject.Models.SOWIDataTestModel> GetView(out SOWIData.Management.ListViewConfig pViewConfig, string pViewName, Dictionary<string, string> pDictionaryUI = null) { pViewConfig = new SOWIData.Management.ListViewConfig(); return new List<TestObject.Models.SOWIDataTestModel>(); } public void Import(string pFile) { throw new NotImplementedException(); } public void Import(Stream pStream, string pFileName = "", string pContentType = "") { throw new NotImplementedException(); } public TestObject.Models.SOWIDataTestModel Insert(TestObject.Models.SOWIDataTestModel pItem) { throw new NotImplementedException(); } public bool PermissionCheck(SOWIData.Management.CRUD[] pClaims) { return true; } public TestObject.Models.SOWIDataTestModel Update(TestObject.Models.SOWIDataTestModel pItem) { throw new NotImplementedException(); } public void Upload(string pFile) { System.Diagnostics.Debug.WriteLine("TestObject.SOWIAppController.Uplaod"); //throw new NotImplementedException(); } public void Upload(ref TestObject.Models.SOWIDataTestModel pItem, SOWIData.Helper.Models.FileContent pFileContent) { System.Diagnostics.Debug.WriteLine("TestObject.SOWIAppController.Uplaod"); //throw new NotImplementedException(); } public SOWIData.Helper.ModelState Validate(TestObject.Models.SOWIDataTestModel pItem, SOWIData.Actions pAction) { return new SOWIData.Helper.ModelState(); } }
A example of a simple SOWI Test Data
/// <summary> /// A simple test data model /// </summary> public class SOWIDataTestModel { /// <summary> /// Constructor without parameter /// </summary> public SOWIDataTestModel() { } public int ID { get; set; } public string Name { get; set; } }