Beispiel #1
0
        public void TestControlVMInit()
        {
            // When ControlInit is called, the SelectedYear should be set to the first item of the generated List of keys
            controlVM.ControlInit();

            // Pull a copy from ControlVM's stored key value, as well as from the list of keys directly
            IncomeYearModel testOutputFromInit;
            IncomeYearModel testOutputFromList;

            yearsModel.Years.TryGetValue(controlVM.SelectedYear, out testOutputFromInit);
            yearsModel.Years.TryGetValue(yearsModel.YearList[0], out testOutputFromList);

            // Neither of the objects should be null
            Assert.IsNotNull(testOutputFromInit);
            Assert.IsNotNull(testOutputFromList);

            // They should also be the same object
            Assert.AreSame(testOutputFromInit, testOutputFromList);
        }