Ejemplo n.º 1
0
        public void TestSelectCategory()
        {
            EZMoneyModel            ezMoneyModel  = new EZMoneyModel();                        // TODO: 初始化為適當值
            RecordPresentationModel recordPModel  = new RecordPresentationModel(ezMoneyModel); // TODO: 初始化為適當值
            RecordModel             recordModel   = ezMoneyModel.RecordModel;
            CategoryModel           categoryModel = ezMoneyModel.CategoryModel;

            recordPModel.InitializeState();
            categoryModel.AddCategory(CATEGORY_NAME_WORK);
            recordPModel.SelectCategory(0);
            Assert.AreEqual(0, recordPModel.CategoryIndex);
        }
Ejemplo n.º 2
0
        public void TestSetErrorProvider()
        {
            EZMoneyModel ezMoneyModel = new EZMoneyModel(); // TODO: 初始化為適當值

            ezMoneyModel.GetCategories().Clear();
            ezMoneyModel.GetRecords().Clear();
            RecordPresentationModel recordPModel = new RecordPresentationModel(ezMoneyModel); // TODO: 初始化為適當值
            Category category = new Category(CATEGORY_NAME_WORK);

            ezMoneyModel.AddCategory(category);
            recordPModel.InitializeState();
            const String FIFTY = "50";

            recordPModel.ChangeAmount(FIFTY);
            recordPModel.SetErrorProvider();
            Assert.AreEqual(RecordPresentationModel.NO_SELECT_CATEGORY_INFO, recordPModel.ErrorProviderMessage);
            recordPModel.SelectCategory(0);
            Assert.AreEqual(RecordPresentationModel.EMPTY_ERROR_MESSAGE, recordPModel.ErrorProviderMessage);
        }
 public void TestSetErrorProvider()
 {
     EZMoneyModel ezMoneyModel = new EZMoneyModel(); // TODO: 初始化為適當值
     ezMoneyModel.GetCategories().Clear();
     ezMoneyModel.GetRecords().Clear();
     RecordPresentationModel recordPModel = new RecordPresentationModel(ezMoneyModel); // TODO: 初始化為適當值
     Category category = new Category(CATEGORY_NAME_WORK);
     ezMoneyModel.AddCategory(category);
     recordPModel.InitializeState();
     const String FIFTY = "50";
     recordPModel.ChangeAmount(FIFTY);
     recordPModel.SetErrorProvider();
     Assert.AreEqual(RecordPresentationModel.NO_SELECT_CATEGORY_INFO, recordPModel.ErrorProviderMessage);
     recordPModel.SelectCategory(0);
     Assert.AreEqual(RecordPresentationModel.EMPTY_ERROR_MESSAGE, recordPModel.ErrorProviderMessage);
 }
 public void TestSelectCategory()
 {
     EZMoneyModel ezMoneyModel = new EZMoneyModel(); // TODO: 初始化為適當值
     RecordPresentationModel recordPModel = new RecordPresentationModel(ezMoneyModel); // TODO: 初始化為適當值
     RecordModel recordModel = ezMoneyModel.RecordModel;
     CategoryModel categoryModel = ezMoneyModel.CategoryModel;
     recordPModel.InitializeState();
     categoryModel.AddCategory(CATEGORY_NAME_WORK);
     recordPModel.SelectCategory(0);
     Assert.AreEqual(0, recordPModel.CategoryIndex);
 }