public void InstantiateListObjMgrs_MissingCtrParams_Throws(string wshNm, string tblNm)
        {
            WshListobjPair    pr = new WshListobjPair(tblNm, wshNm);
            GenericListObjMgr mgr;

            var ex = Assert.Catch <InvalidWshListObjPairException>(() =>
                                                                   mgr = new GenericListObjMgr(pr));
        }
        public void InstantiateListObjectMgrs_NonEmptyWshTblNmz_Succeeds(string wshNm, string tblNm)
        {
            // Arrange & act...
            WshListobjPair    pr  = new WshListobjPair(tblNm, wshNm);
            GenericListObjMgr mgr = new GenericListObjMgr(pr);

            // Assert...
            Assert.IsInstanceOf <GenericListObjMgr>(mgr);
        }
        public void SetListObjAndParentWshPpts_MissingWsh_Throws(string wshNm, string tblNm)
        {
            WshListobjPair pr  = new WshListobjPair(tblNm, wshNm);
            var            mgr = Substitute.ForPartsOf <GenericListObjMgr>(pr);

            mgr.When(x => x.DoesParentWshExist()).DoNotCallBase();
            mgr.DoesParentWshExist().Returns(false);

            var ex = Assert.Catch <MissingWorksheetException>(() =>
                                                              mgr.SetListObjAndParentWshPpts());
        }
        public void SetListObjAndParentWshPpt_GoodCtrParam_SetsVerifiedFlagTrue(string wshNm, string tblNm)
        {
            WshListobjPair pr  = new WshListobjPair(tblNm, wshNm);
            var            mgr = Substitute.ForPartsOf <GenericListObjMgr>(pr);

            mgr.When(x =>
            {
                x.DoesParentWshExist().Returns(true);
                x.DoesListObjExist().Returns(false);
                x.SetListObjAndParentWshPpts();
                Assert.True(x.UnderlyingWshAndListObjVerified);
            });
        }
        public void SetListObjAndParentWshPpts_MissingListObj_Throws(string wshNm, string tblNm)
        {
            WshListobjPair pr  = new WshListobjPair(tblNm, wshNm);
            var            mgr = Substitute.ForPartsOf <GenericListObjMgr>(pr);

            mgr.When(x =>
            {
                x.DoesParentWshExist().Returns(true);
                x.DoesListObjExist().Returns(false);
                var ex = Assert.Catch <MissingListObjectException>(() =>
                                                                   x.SetListObjAndParentWshPpts());
            });
        }
Beispiel #6
0
 /// <summary>
 /// Initializes a new instance of the
 /// class <see cref="iClickerQuizPts.ListObjMgmt.XLListObjWrapper"/>.
 /// </summary>
 /// <param name="wshTblNmzPair">The properties of this <see langword="struct"/>
 /// should be populated with the name of the <see cref="Excel.ListObject"/>
 /// and the name of the parent <see cref="Excel.Worksheet"/>.</param>
 /// <exception cref="iClickerQuizPts.AppExceptions.InvalidWshListObjPairException"> thrown
 /// whenever the <see cref="iClickerQuizPts.WshListobjPair.WshNm"/> property
 /// or the the <see cref="iClickerQuizPts.WshListobjPair.ListObjName"/> property
 /// has not been populated.  (In other words, <i>both</i> properties must contain non-empty,
 /// non-null values.)</exception>
 protected XLListObjWrapper(WshListobjPair wshTblNmzPair)
 {
     // Trap to ensure that constructor parameter has been populated with both
     // a wsh name and a ListObject name...
     if (wshTblNmzPair.PptsSet)
     {
         _wshLoPr = wshTblNmzPair;
     }
     else
     {
         InvalidWshListObjPairException ex = new InvalidWshListObjPairException();
         ex.WshListObjPair = wshTblNmzPair;
         throw ex;
     }
 }
 /// <summary>
 /// Initializes a new instance of the
 /// class <see cref="iClickerQuizPts.ListObjMgmt.DblDippersLOWrapper"/>.
 /// </summary>
 /// <param name="wshTblNmzPair">The properties of this <see langword="struct"/>
 /// should be populated with the name of the <see cref="Excel.ListObject"/>
 /// containing the double-dipping students and the name
 /// of the parent <see cref="Excel.Worksheet"/>.</param>
 public DblDippersLOWrapper(WshListobjPair wshTblNmzPair) : base(wshTblNmzPair)
 {
 }
 public GenericListObjMgr(WshListobjPair pr) : base(pr)
 {
 }
 /// <summary>
 /// Initializes a new instance of the
 /// class <see cref="iClickerQuizPts.ListObjMgmt.QuizDataLOWrapper"/>.
 /// </summary>
 /// <param name="wshTblNmzPair">The properties of this <see langword="struct"/>
 /// should be populated with the name of the <see cref="Excel.ListObject"/>
 /// containing the iClicker quiz data and the name
 /// of the parent <see cref="Excel.Worksheet"/>.</param>
 public QuizDataLOWrapper(WshListobjPair wshTblNmzPair) : base(wshTblNmzPair)
 {
 }