public void TestWallClimbingActivityConstructor()
        {
            WallClimbingActivity activity = new WallClimbingActivity();

            Assert.AreEqual <string>("", activity.ID);
            Assert.AreEqual <decimal>(0, activity.cost);
            Assert.AreEqual <string>("", activity.activityName);
        }
        public void TestWallClimbingActivityIDCostConstructor()
        {
            WallClimbingActivity activity = new WallClimbingActivity("ID", 700.0M);

            Assert.AreEqual <string>("ID", activity.ID);
            Assert.AreEqual <decimal>(700.0M, activity.cost);
            Assert.AreEqual <string>("Wall Climbing", activity.activityName);
        }
Exemplo n.º 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 TestWallClimbingActivityCreateActivity()
        {
            WallClimbingActivity activity = new WallClimbingActivity();

            Assert.IsInstanceOfType(activity.CreateActivity("ID", 10.0M), typeof(WallClimbingActivity));
        }