public void TestMeetOpens() { Console.WriteLine("Inside " + GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name); SavingJsonSvcImpl savingImplObject = new SavingJsonSvcImpl(); Meet openedMeet = savingImplObject.openMeet(testFileName); Console.WriteLine("Opened Meet:"); Console.WriteLine(openedMeet.ToString()); Console.WriteLine("\nControl Meet:"); Console.WriteLine(testMeet.ToString()); bool test = openedMeet.Equals(testMeet); Assert.True(test, GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Failed"); Console.WriteLine(GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Passed"); }
public void TestOpenMeetMeetMgr() { Console.WriteLine("Inside " + GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name); MeetMgr mMgr = new MeetMgr(); Meet openedMeet = mMgr.openMeet(testFileName); Console.WriteLine("Opened Meet:"); Console.WriteLine(openedMeet.ToString()); Console.WriteLine("\nControl Meet:"); Console.WriteLine(testMeet.ToString()); bool test = openedMeet.Equals(testMeet); Assert.True(test, GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Failed"); Console.WriteLine(GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Passed"); }
public void TestToStringMethod() { Console.WriteLine("Inside " + GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name); Performance myPerformance1 = new Performance("A", "AA", 1.1m); Performance myPerformance2 = new Performance("B", "BB", 2.2m); Performance myPerformance3 = new Performance("C", "CC", 3.3m); Performance myPerformance4 = new Performance("D", "DD", 4.1m); List <Performance> myPerformancesA = new List <Performance>(); myPerformancesA.Add(myPerformance1); myPerformancesA.Add(myPerformance2); List <Performance> myPerformancesB = new List <Performance>(); myPerformancesB.Add(myPerformance3); myPerformancesB.Add(myPerformance4); Dictionary <string, List <Performance> > myEventsA = new Dictionary <string, List <Performance> >(); myEventsA.Add("Boy's 100", myPerformancesA); myEventsA.Add("Boy's 200", myPerformancesB); Dictionary <string, string> boysNamesA = new Dictionary <string, string>(); boysNamesA.Add("BLN", "Baldwin"); boysNamesA.Add("TJ", "Thomas Jefferson"); boysNamesA.Add("WHS", "Washington HS"); Dictionary <string, string> girlsNamesA = new Dictionary <string, string>(); girlsNamesA.Add("PLM", "Plum"); girlsNamesA.Add("GWY", "Gateway"); girlsNamesA.Add("KCH", "Knoch"); Teams teams = new Teams(boysNamesA, girlsNamesA); Meet myMeet = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams, myEventsA); string strMeet = myMeet.ToString(); Console.WriteLine("My string:" + Environment.NewLine + Environment.NewLine); Console.WriteLine(strMeet + Environment.NewLine); Console.WriteLine("Expecting:" + Environment.NewLine + Environment.NewLine); Console.WriteLine("Date: 04/13/2017" + Environment.NewLine + "Location: " + "Baldwin HS" + Environment.NewLine + "Weather Conditions: " + "Windy" + Environment.NewLine + "Teams:" + Environment.NewLine + "Boys:" + Environment.NewLine + "Baldwin - BLN" + Environment.NewLine + "Thomas Jefferson - TJ" + Environment.NewLine + "Washington HS - WHS" + Environment.NewLine + "Girls:" + Environment.NewLine + "Plum - PLM" + Environment.NewLine + "Gateway - GWY" + Environment.NewLine + "Knoch - KCH" + Environment.NewLine + "Event: " + "Boy's 100" + Environment.NewLine + "Name: " + "A" + ", " + "AA" + " - " + 1.1 + Environment.NewLine + "Name: " + "B" + ", " + "BB" + " - " + 2.2 + Environment.NewLine + "Event: " + "Boy's 200" + Environment.NewLine + "Name: " + "C" + ", " + "CC" + " - " + 3.3 + Environment.NewLine + "Name: " + "D" + ", " + "DD" + " - " + 4.1); Assert.AreEqual(strMeet, "Date: 04/13/2017" + Environment.NewLine + "Location: " + "Baldwin HS" + Environment.NewLine + "Weather Conditions: " + "Windy" + Environment.NewLine + "Teams:" + Environment.NewLine + "Boys:" + Environment.NewLine + "Baldwin - BLN" + Environment.NewLine + "Thomas Jefferson - TJ" + Environment.NewLine + "Washington HS - WHS" + Environment.NewLine + "Girls:" + Environment.NewLine + "Plum - PLM" + Environment.NewLine + "Gateway - GWY" + Environment.NewLine + "Knoch - KCH" + Environment.NewLine + "Event: " + "Boy's 100" + Environment.NewLine + "Name: " + "A" + ", " + "AA" + " - " + 1.1 + Environment.NewLine + "Name: " + "B" + ", " + "BB" + " - " + 2.2 + Environment.NewLine + "Event: " + "Boy's 200" + Environment.NewLine + "Name: " + "C" + ", " + "CC" + " - " + 3.3 + Environment.NewLine + "Name: " + "D" + ", " + "DD" + " - " + 4.1, GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Failed"); Console.WriteLine(GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Passed"); }