public void DateTimeIntellisenseProvider_GetIntellisenseResults_ErrorResult_ExpectResultIfNonErrorType()
        {
            //------------Setup for test--------------------------
            var context = new IntellisenseProviderContext
            {
                CaretPosition     = 1,
                InputText         = "dod",
                IsInCalculateMode = false,
                DesiredResultSet  = IntellisenseDesiredResultSet.EntireSet
            };

            var res = new Mock <IIntellisenseResult>();
            var opt = new Mock <IDataListVerifyPart>();

            opt.Setup(a => a.DisplayValue).Returns("dora");

            res.Setup(a => a.ErrorCode).Returns(enIntellisenseErrorCode.InvalidRecordsetNotation);
            res.Setup(a => a.Type).Returns(enIntellisenseResultType.Selectable);
            res.Setup(a => a.IsClosedRegion).Returns(false);
            res.Setup(a => a.Message).Returns("bob");
            res.Setup(a => a.Option).Returns(opt.Object);
            var dateTimeIntellisenseProvider = new DateTimeIntellisenseProvider(new List <IIntellisenseResult> {
                res.Object
            });
            var count = dateTimeIntellisenseProvider.IntellisenseResults.Count;

            //------------Execute Test---------------------------

            var results = dateTimeIntellisenseProvider.GetIntellisenseResults(context);

            //------------Assert Results-------------------------
            Assert.AreEqual(1, results.Count);
            Assert.AreEqual(count, 1); // check that there was stuff to add
        }
        public void DateTimeIntellisenseProvider_GetIntellisenseResults_PartialMethodMatch_ClosestMatchesReturned()
        {
            var context = new IntellisenseProviderContext
            {
                CaretPosition     = 1,
                InputText         = "d",
                IsInCalculateMode = false,
                DesiredResultSet  = IntellisenseDesiredResultSet.ClosestMatch
            };

            var dateTimeIntellisenseProvider           = new DateTimeIntellisenseProvider();
            IList <IntellisenseProviderResult> results = dateTimeIntellisenseProvider.GetIntellisenseResults(context);

            Assert.AreEqual(6, results.Count);
        }