public void testParseGraduationDate()
        {
            String sXML = "<StudentPersonal RefId='12345678901234567890'>"
                          + " <GradYear Type='Actual'>2005</GradYear>"
                          + "</StudentPersonal>";

            StudentPersonal sp = (StudentPersonal)parseSIF15r1XML(sXML);

            sp = (StudentPersonal)AdkObjectParseHelper.WriteParseAndReturn(sp, SifVersion.SIF11);
            Assertion.AssertNotNull(sp);
            PartialDateType gd = sp.GraduationDate;

            Assertion.AssertNotNull("Actual Grad Year", gd);
            Assertion.AssertEquals("Actual Grad Year", 2005, (int)gd.Year);

            Adk.SifVersion = SifVersion.SIF15r1;
            sp             = new StudentPersonal();
            sp.SetElementOrAttribute("GradYear[@Type='Actual']", "2054");
            gd = sp.GraduationDate;
            Assertion.AssertNotNull("Actual Grad Year", gd);
            Assertion.AssertNotNull("GraduationDate/getYear()", gd.Year);
            Assertion.AssertEquals("Actual Grad Year", 2054, gd.Year.Value);

            Element gradValue = sp.GetElementOrAttribute("GradYear[@Type='Actual']");

            Assertion.AssertNotNull("Actual Grad Year", gradValue);
            PartialDateType pdt = (PartialDateType)gradValue;

            Assertion.AssertEquals("Actual Grad Year", 2054, pdt.Year.Value);
        }
Exemple #2
0
        public void testPartialDate040()
        {
            DateTime?       c    = Adk.Dtd.GetFormatter(SifVersion.SIF20).ToDate("1999-12-25");
            PartialDateType date = new PartialDateType(c);

            assertPartialDate(date, 1999, 12, 25, "1999-12-25");
        }
        public void testParseGraduationDateSS()
        {
            String sXML = "<StudentSnapshot StudentPersonalRefId='12345678901234567890'>"
                          + " <GradYear Type='Actual'>2005</GradYear>"
                          + "</StudentSnapshot>";

            StudentSnapshot sp = (StudentSnapshot)parseSIF15r1XML(sXML);

            sp = (StudentSnapshot)AdkObjectParseHelper.WriteParseAndReturn(sp, SifVersion.SIF15r1);
            Assertion.AssertNotNull(sp);
            PartialDateType gd = sp.GraduationDate;

            Assertion.AssertNotNull("Actual Grad Year", gd);
            Assertion.AssertEquals("Actual Grad Year", 2005, (int)gd.Year);

            Adk.SifVersion = SifVersion.SIF15r1;
            sp             = new StudentSnapshot();
            sp.SetElementOrAttribute("GradYear[@Type='Actual']", "2054");
            gd = sp.GraduationDate;
            Assertion.AssertNotNull("Actual Grad Year", gd);
            Assertion.AssertEquals("Actual Grad Year", 2054, (int)gd.Year);

            Element gradValue = sp.GetElementOrAttribute("GradYear[@Type='Actual']");

            Assertion.AssertNotNull("Actual Grad Year", gradValue);
            Assert.IsTrue(gradValue is PartialDateType, "Should be a partial date type");
            PartialDateType gradYear = (PartialDateType)gradValue;

            Assertion.AssertEquals("Actual Grad Year", 2054, gradYear.Year.Value);
        }
Exemple #4
0
        public void testPartialDate010()
        {
            PartialDateType date = new PartialDateType(1999);

            Assert.AreEqual((int)date.Year, 1999);
            Assert.AreEqual(PartialDateType.DateType.GYear, date.DataType);
        }
Exemple #5
0
 /// <summary>
 /// Constructor that accepts values for all mandatory fields
 /// </summary>
 ///<param name="name">Textual description of assessment.</param>
 ///<param name="administrationDate">Date the assessment was administered.</param>
 ///<param name="studentGradeLevelWhenAssessed">Student's grade level when assessed.</param>
 ///<param name="testScoreType">Type of test score</param>
 ///<param name="testScore">Test score.</param>
 ///
 public AssessmentHistory(string name, PartialDateType administrationDate, GradeLevel studentGradeLevelWhenAssessed, AssessmentReportingMethod testScoreType, string testScore) : base(EtranscriptsDTD.ASSESSMENTHISTORY)
 {
     this.Name = name;
     this.AdministrationDate            = administrationDate;
     this.StudentGradeLevelWhenAssessed = studentGradeLevelWhenAssessed;
     this.SetTestScoreType(testScoreType);
     this.TestScore = testScore;
 }
Exemple #6
0
        public void testPartialDate013()
        {
            PartialDateType date = new PartialDateType("1999-06:00");

            Assert.AreEqual(1999, date.Year);
            Assert.AreEqual("1999-06:00", date.Value);
            Assert.AreEqual("1999-06:00", date.TextValue);
            Assert.AreEqual(PartialDateType.DateType.GYear, date.DataType);
        }
Exemple #7
0
        public void testPartialDate014()
        {
            PartialDateType date = new PartialDateType(1999);

            Assert.AreEqual((int)date.Year, 1999);
            Assert.AreEqual(date.Value, "1999");
            Assert.AreEqual(date.TextValue, "1999");
            Assert.AreEqual(PartialDateType.DateType.GYear, date.DataType);
        }
Exemple #8
0
        public void testPartialDate021()
        {
            PartialDateType date = new PartialDateType("1999-12Z");

            Assert.AreEqual(1999, (int)date.Year);
            Assert.AreEqual(12, (int)date.Month);
            Assert.AreEqual("1999-12Z", date.Value);
            Assert.AreEqual("1999-12Z", date.TextValue);
            Assert.AreEqual(PartialDateType.DateType.GYearMonth, date.DataType);
        }
Exemple #9
0
        public void testPartialDate022()
        {
            PartialDateType date = new PartialDateType("0010-12-06:00");

            Assert.AreEqual(10, (int)date.Year);
            Assert.AreEqual(12, (int)date.Month);
            Assert.IsNull(date.Day);
            Assert.AreEqual("0010-12-06:00", date.Value);
            Assert.AreEqual("0010-12-06:00", date.TextValue);
            Assert.AreEqual(PartialDateType.DateType.GYearMonth, date.DataType);
        }
Exemple #10
0
        public void testPartialDate050()
        {
            PartialDateType date = new PartialDateType(1999, 12, 25);

            assertPartialDate(date, 1999, 12, 25, "1999-12-25");

            date.TextValue = "1999-12-06:00";
            Assert.AreEqual(1999, (int)date.Year);
            Assert.AreEqual(12, (int)date.Month);
            Assert.IsNull(date.Day);
            Assert.AreEqual(date.Value, "1999-12-06:00");
            Assert.AreEqual(date.TextValue, "1999-12-06:00");

            date.TextValue = "2007-06-01";
            assertPartialDate(date, 2007, 06, 01, "2007-06-01");

            date.TextValue = "2020-06-05Z";
            assertPartialDate(date, 2020, 06, 05, "2020-06-05Z");
        }
Exemple #11
0
        //[Test]
        public void assertPartialDate(PartialDateType date, int year, int month, int day, String lexicalValue)
        {
            Assert.AreEqual(year, date.Year.Value);
            Assert.AreEqual(month, date.Month.Value);
            Assert.AreEqual(day, date.Day.Value);

            DateTime cal = date.Date;

            Assert.IsNotNull(cal, "PartialDateType.getDate()");

            Assert.AreEqual(year, cal.Year);
            Assert.AreEqual(month, cal.Month);
            Assert.AreEqual(day, cal.Day);

            Assert.AreEqual(date.Value, lexicalValue);
            Assert.AreEqual(date.TextValue, lexicalValue);

            Assert.AreEqual(PartialDateType.DateType.Date, date.DataType);
        }
Exemple #12
0
        public void testPartialDate007()
        {
            PartialDateType date = new PartialDateType("2006-06-01Z");

            assertPartialDate(date, 2006, 6, 1, "2006-06-01Z");
        }
 ///<summary>Adds the value of the <c>&lt;Assessment&gt;</c> element.</summary>
 /// <param name="Name">Textual description of assessment.</param>
 /// <param name="AdministrationDate">Date the assessment was administered.</param>
 /// <param name="StudentGradeLevelWhenAssessed">Student's grade level when assessed.</param>
 /// <param name="TestScoreType">Type of test score</param>
 /// <param name="TestScore">Test score.</param>
 ///<remarks>
 /// <para>This form of <c>setAssessment</c> is provided as a convenience method
 /// that is functionally equivalent to the method <c>AddAssessment</c></para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 2.0</para>
 /// </remarks>
 public void AddAssessment(string Name, PartialDateType AdministrationDate, GradeLevel StudentGradeLevelWhenAssessed, AssessmentReportingMethod TestScoreType, string TestScore)
 {
     AddChild(EtranscriptsDTD.ASSESSMENTPERFORMANCEHISTORY_ASSESSMENT, new AssessmentHistory(Name, AdministrationDate, StudentGradeLevelWhenAssessed, TestScoreType, TestScore));
 }
 ///<summary>Adds the value of the <c>&lt;StudentSchoolEnrollmentData&gt;</c> element.</summary>
 /// <param name="SchoolAttendedRefId">Reference to School Attended.</param>
 /// <param name="SchoolYear">A SchoolYear</param>
 /// <param name="EntryDate">An EntryDate</param>
 ///<remarks>
 /// <para>This form of <c>setStudentSchoolEnrollmentData</c> is provided as a convenience method
 /// that is functionally equivalent to the method <c>AddStudentSchoolEnrollmentData</c></para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 2.0</para>
 /// </remarks>
 public void AddStudentSchoolEnrollmentData(string SchoolAttendedRefId, int?SchoolYear, PartialDateType EntryDate)
 {
     AddChild(EtranscriptsDTD.ENROLLMENTHISTORY_STUDENTSCHOOLENROLLMENTDATA, new StudentSchoolEnrollmentHistory(SchoolAttendedRefId, SchoolYear, EntryDate));
 }
Exemple #15
0
        public void testPartialDate030()
        {
            PartialDateType date = new PartialDateType(10, 12, 25);

            assertPartialDate(date, 10, 12, 25, "0010-12-25");
        }
Exemple #16
0
        public void testPartialDate005()
        {
            PartialDateType date = new PartialDateType("1999-12-25");

            assertPartialDate(date, 1999, 12, 25, "1999-12-25");
        }
 ///<summary>Adds the value of the <c>&lt;Requirement&gt;</c> element.</summary>
 /// <param name="Method">The method by which the requirement was met.</param>
 /// <param name="StatusDeterminationDate">Date the student's status was determined.</param>
 ///<remarks>
 /// <para>This form of <c>setRequirement</c> is provided as a convenience method
 /// that is functionally equivalent to the method <c>AddRequirement</c></para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 2.0</para>
 /// </remarks>
 public void AddRequirement(string Method, PartialDateType StatusDeterminationDate)
 {
     AddChild(EtranscriptsDTD.ADDITIONALGRADUATIONREQUIREMENTPERFORMANCEHISTORY_REQUIREMENT, new Requirement(Method, StatusDeterminationDate));
 }
Exemple #18
0
 /// <summary>
 /// Constructor that accepts values for all mandatory fields
 /// </summary>
 ///<param name="schoolAttendedRefId">Reference to School Attended.</param>
 ///<param name="schoolYear">A SchoolYear</param>
 ///<param name="entryDate">An EntryDate</param>
 ///
 public StudentSchoolEnrollmentHistory(string schoolAttendedRefId, int?schoolYear, PartialDateType entryDate) : base(EtranscriptsDTD.STUDENTSCHOOLENROLLMENTHISTORY)
 {
     this.SchoolAttendedRefId = schoolAttendedRefId;
     this.SchoolYear          = schoolYear;
     this.EntryDate           = entryDate;
 }
Exemple #19
0
 /// <summary>
 /// Constructor that accepts values for all mandatory fields
 /// </summary>
 ///<param name="method">The method by which the requirement was met.</param>
 ///<param name="statusDeterminationDate">Date the student's status was determined.</param>
 ///
 public Requirement(string method, PartialDateType statusDeterminationDate) : base(EtranscriptsDTD.REQUIREMENT)
 {
     this.Method = method;
     this.StatusDeterminationDate = statusDeterminationDate;
 }