예제 #1
0
        public static void GetAllSpecialCaseDescriptionTest(bool isUseAddition,
                                                            string strMinus1, string strMinus2, string strMinus3)
        {
            var instance = new CommonEventSpecialNumberArgDesc.InnerDescNormal();
            var changedDescPropertyList = new List <string>();

            instance.PropertyChanged += (sender, args) => { changedDescPropertyList.Add(args.PropertyName); };
            var changedSpecialArgCaseListPropertyList = new List <string>();

            instance.SpecialArgCaseList.PropertyChanged += (sender, args) =>
            {
                changedSpecialArgCaseListPropertyList.Add(args.PropertyName);
            };
            var changedSpecialArgCaseListCollectionArgList = new List <NotifyCollectionChangedEventArgs>();

            instance.SpecialArgCaseList.CollectionChanged += (sender, args) =>
            {
                changedSpecialArgCaseListCollectionArgList.Add(args);
            };

            var errorOccured = false;

            try
            {
                instance.GetAllSpecialCaseDescription();
            }
            catch (Exception ex)
            {
                logger.Exception(ex);
                errorOccured = true;
            }

            // エラーが発生しないこと
            Assert.IsFalse(errorOccured);

            // 取得した配列数が0件であること
            var argCaseLength = instance.GetAllSpecialCase().Count;

            Assert.AreEqual(argCaseLength, 0);

            // プロパティ変更通知が発火していないこと
            Assert.AreEqual(changedDescPropertyList.Count, 0);
            Assert.AreEqual(changedSpecialArgCaseListPropertyList.Count, 0);
            Assert.AreEqual(changedSpecialArgCaseListCollectionArgList.Count, 0);
        }