public void TestGoKartIDCostConstructor()
        {
            GoKartActivity activity = new GoKartActivity("ID", 1400.0M);

            Assert.AreEqual <string>("ID", activity.ID);
            Assert.AreEqual <decimal>(1400.0M, activity.cost);
            Assert.AreEqual <string>("Go Kart", activity.activityName);
        }
        public void TestGoKartConstructor()
        {
            GoKartActivity activity = new GoKartActivity();

            Assert.AreEqual <string>("", activity.ID);
            Assert.AreEqual <decimal>(0, activity.cost);
            Assert.AreEqual <string>("", activity.activityName);
        }
Пример #3
0
        public void TestFactoryRegisterSucceeds()
        {
            ActivityFactory      factory         = ActivityFactory.GetInstance;
            PrivateObject        privateAccessor = new PrivateObject(factory);
            WallClimbingActivity wallActivity    = new WallClimbingActivity();
            ChoclateProducingAndMarketingActivity chocoActivity = new ChoclateProducingAndMarketingActivity();
            TeamBuildingAndProblemSolvingActivity teamActivity  = new TeamBuildingAndProblemSolvingActivity();
            MeditationAndMindfullnessActivity     mediActivity  = new MeditationAndMindfullnessActivity();
            GoKartActivity goKartActivity = new GoKartActivity();

            factory.Register(ActivityTypes.WALL_CLIMBING, wallActivity);
            factory.Register(ActivityTypes.TEAM_BUILDING_AND_PROBLEM_SOLVING, teamActivity);
            factory.Register(ActivityTypes.CHOCOLATE_PRODUCING_AND_MARKETING, chocoActivity);
            factory.Register(ActivityTypes.MEDITATION_AND_MINDFULLNESS, mediActivity);
            factory.Register(ActivityTypes.GO_KART, goKartActivity);
            Hashtable refActivityMap = (Hashtable)privateAccessor.GetField("activityTable");

            Assert.IsTrue(refActivityMap.ContainsKey(ActivityTypes.WALL_CLIMBING));
            Assert.IsTrue(refActivityMap.ContainsKey(ActivityTypes.TEAM_BUILDING_AND_PROBLEM_SOLVING));
            Assert.IsTrue(refActivityMap.ContainsKey(ActivityTypes.CHOCOLATE_PRODUCING_AND_MARKETING));
            Assert.IsTrue(refActivityMap.ContainsKey(ActivityTypes.MEDITATION_AND_MINDFULLNESS));
            Assert.IsTrue(refActivityMap.ContainsKey(ActivityTypes.GO_KART));
        }
        public void TestGoKartActivityCreateActivity()
        {
            GoKartActivity activity = new GoKartActivity();

            Assert.IsInstanceOfType(activity.CreateActivity("ID", 32.0M), typeof(GoKartActivity));
        }