Example #1
0
        public void CreateChallenge_NoDatabaseLoaded()
        {
            // Use a new Model for this test.
            ModelXml newTestModel = new ModelXml();

            newTestModel.CreateChallenge("new challenge", SplitNamesBefore);
        }
Example #2
0
        public void CreateDatabase_SecondOne()
        {
            // We already have the default database loaded; now try
            // to load a different one to replace it. But first,
            // add a challenge to the default so that there is a
            // difference between the two.
            TestModel.CreateChallenge("challenge1", SplitNamesBefore);

            string filename = "homtest.xml";

            if (System.IO.File.Exists(filename))
            {
                System.IO.File.Delete(filename);
            }

            // Main thing is to check for exceptions thrown during creation.
            TestModel.CreateDatabase(filename);

            List <string> challenges = TestModel.GetChallenges();

            Assert.AreEqual(0, challenges.Count);
        }