Esempio n. 1
0
        public void CreateProcessArgsForTestNullEventThrowsException()
        {
            DateTime           beginTime             = DateTime.Now;
            TimeSpan           runningTime           = new TimeSpan(2, 0, 0);
            double             callArriveMultiplier  = 0.1;
            double             switchDelayMultiplier = 0.1;
            List <ProductType> productTypes          = new List <ProductType> {
                new ProductType("Test", 0.1, 0.1)
            };
            int      maxQueueLength                = 10;
            bool     singleQueueLength             = true;
            TimeSpan excessiveWaitTime             = new TimeSpan(0, 1, 0);
            Dictionary <SalesRepType, int> repNums = new Dictionary <SalesRepType, int>();

            repNums.Add(new SalesRepType("Test"), 2);
            Simulator sim = new Simulator(beginTime, runningTime, callArriveMultiplier, switchDelayMultiplier, productTypes, maxQueueLength, singleQueueLength, excessiveWaitTime, repNums);
            ProcessArgsFactory_Accessor target = new ProcessArgsFactory_Accessor(sim);

            Event e = null;

            EventProcessArgs actual;

            actual = target.CreateProcessArgsFor(e);

            // Should throw exception
        }
Esempio n. 2
0
        public void CreateProcessArgsForTestCompleteService()
        {
            DateTime           beginTime             = DateTime.Now;
            TimeSpan           runningTime           = new TimeSpan(2, 0, 0);
            double             callArriveMultiplier  = 0.1;
            double             switchDelayMultiplier = 0.1;
            List <ProductType> productTypes          = new List <ProductType> {
                new ProductType("Test", 0.1, 0.1)
            };
            int      maxQueueLength                = 10;
            bool     singleQueueLength             = true;
            TimeSpan excessiveWaitTime             = new TimeSpan(0, 1, 0);
            Dictionary <SalesRepType, int> repNums = new Dictionary <SalesRepType, int>();

            repNums.Add(new SalesRepType("Test"), 2);
            Simulator sim = new Simulator(beginTime, runningTime, callArriveMultiplier, switchDelayMultiplier, productTypes, maxQueueLength, singleQueueLength, excessiveWaitTime, repNums);
            ProcessArgsFactory_Accessor target = new ProcessArgsFactory_Accessor(sim);

            Event e = new CompletedServiceEvent(null, DateTime.Now);

            EventProcessArgs actual;

            actual = target.CreateProcessArgsFor(e);
            Assert.IsInstanceOfType(actual, typeof(CompletedServiceProcessArgs));
        }
Esempio n. 3
0
        public void ProcessArgsFactoryConstructorTestNormal()
        {
            DateTime           beginTime             = DateTime.Now;
            TimeSpan           runningTime           = new TimeSpan(2, 0, 0);
            double             callArriveMultiplier  = 0.1;
            double             switchDelayMultiplier = 0.1;
            List <ProductType> productTypes          = new List <ProductType> {
                new ProductType("Test", 0.1, 0.1)
            };
            int      maxQueueLength                = 10;
            bool     singleQueueLength             = true;
            TimeSpan excessiveWaitTime             = new TimeSpan(0, 1, 0);
            Dictionary <SalesRepType, int> repNums = new Dictionary <SalesRepType, int>();

            repNums.Add(new SalesRepType("Test"), 2);
            Simulator sim = new Simulator(beginTime, runningTime, callArriveMultiplier, switchDelayMultiplier, productTypes, maxQueueLength, singleQueueLength, excessiveWaitTime, repNums);
            ProcessArgsFactory_Accessor target = new ProcessArgsFactory_Accessor(sim);

            Assert.IsInstanceOfType(target.Target, typeof(ProcessArgsFactory));
            Assert.AreEqual(sim, target.sim);
        }