Esempio n. 1
0
        public void TestToData()
        {
            var hs   = AmericanHighSchool.RandomHighSchool();
            var univ = AmericanUniversity.RandomUniversity();

            var eightYearsAgo = DateTime.Today.AddYears(-8).Year;
            var fourYearsAgo  = DateTime.Today.AddYears(-4).Year;

            var hsGradDate   = new DateTime(eightYearsAgo, 5, 25);
            var univGradDate = new DateTime(fourYearsAgo, 5, 15);

            var testSubject = new AmericanEducation(new Tuple <IUniversity, DateTime?>(univ, univGradDate),
                                                    new Tuple <IHighSchool, DateTime?>(hs, hsGradDate));
            var testResult = testSubject.ToData(KindsOfTextCase.Kabab);

            Assert.IsNotNull(testResult);
            Assert.AreNotEqual(0, testResult.Count);
            foreach (var t in testResult.Keys)
            {
                Console.WriteLine($"{t}, {testResult[t]}");
            }

            Console.WriteLine();
            testSubject.AddHighSchool(AmericanHighSchool.RandomHighSchool(), null);
            testResult = testSubject.ToData(KindsOfTextCase.Kabab);
            Assert.IsNotNull(testResult);
            Assert.AreNotEqual(0, testResult.Count);
            foreach (var t in testResult.Keys)
            {
                Console.WriteLine($"{t}, {testResult[t]}");
            }
        }
Esempio n. 2
0
        public void TestRandomUniversity()
        {
            var testResult = AmericanUniversity.RandomUniversity("CA");

            Assert.IsNotNull(testResult);
            Assert.IsFalse(string.IsNullOrWhiteSpace(testResult.Name));
            Assert.IsFalse(string.IsNullOrWhiteSpace(testResult.StateName));
            Assert.IsFalse(string.IsNullOrWhiteSpace(testResult.StateAbbrev));
            Assert.IsNotNull(testResult.PercentOfStateStudents);
            Assert.IsFalse(testResult.PercentOfStateStudents == 0.0f);
        }
Esempio n. 3
0
        public void TestEduLevel()
        {
            var hs   = AmericanHighSchool.RandomHighSchool();
            var univ = AmericanUniversity.RandomUniversity();

            var eightYearsAgo = DateTime.Today.AddYears(-8).Year;
            var fourYearsAgo  = DateTime.Today.AddYears(-4).Year;

            var hsGradDate   = new DateTime(eightYearsAgo, 5, 25);
            var univGradDate = new DateTime(fourYearsAgo, 5, 15);

            var testSubject = new AmericanEducation(new Tuple <IUniversity, DateTime?>(univ, univGradDate),
                                                    new Tuple <IHighSchool, DateTime?>(hs, hsGradDate));

            Assert.AreEqual("College Grad", testSubject.EduLevel);
        }