public void SDOParse()
        {
            DateTime today = DateTime.Now;

            Demographics demo = new Demographics();

            demo.CountriesOfCitizenship = new CountriesOfCitizenship();
            demo.CountriesOfCitizenship.AddCountryOfCitizenship(CountryCode.US);
            demo.CountriesOfCitizenship.AddCountryOfCitizenship(CountryCode.Wrap("CA"));
            demo.CountriesOfResidency = new CountriesOfResidency(new Country(CountryCode.Wrap("CA")));
            demo.CountryOfBirth       = CountryCode.US.ToString();

            //  Create a StudentPlacement
            StudentPlacement sp = new StudentPlacement();

            sp.RefId = Adk.MakeGuid();
            sp.StudentParticipationRefId = Adk.MakeGuid();
            sp.StudentPersonalRefId      = Adk.MakeGuid();
            sp.SetService(ServiceCode.STAFF_PROFESSIONAL_DEVELOPMENT, "foo", "test");
            sp.ServiceProviderAgency = "ABSD";
            sp.ServiceProviderName   = "John Smithfield";
            sp.SetServiceSetting("asdfasdf", ServiceSettingCode.REGULAR_SCHOOL_CAMPUS);
            sp.StartDate     = today;
            sp.FrequencyTime = new FrequencyTime();
            sp.SetIndirectTime(DurationUnit.MINUTES, 10);
            sp.TotalServiceDuration       = new TimeUnit(DurationUnit.MINUTES, 5);
            sp.SpecialNeedsTransportation = false;
            sp.AssistiveTechnology        = true;
            sp.SetDirectTime(DurationUnit.HOURS, 5);

            AdkObjectParseHelper.runParsingTest(sp, SifVersion.LATEST);
        }
예제 #2
0
 private void assertStudentParticipation(StudentPlacement sp)
 {
     Assert.AreEqual("0000000000000000", sp.RefId, "RefID");
     Assert.AreEqual("0000000000000000", sp.StudentPersonalRefId, "StudentPersonalRefid");
     Assert.AreEqual("Local", sp.Service.CodeType, "Code Type");
     Assert.AreEqual("Related Service", sp.Service.Type, "Type");
     Assert.AreEqual("ZZZ99987", sp.Service.TextValue, "Service");
 }
예제 #3
0
 protected override void assertStudentPlacement(StudentPlacement sp)
 {
     Assertion.AssertEquals("RefID", "0000000000000000", sp.RefId);
     Assertion.AssertEquals("StudentPersonalRefid", "0000000000000000", sp.StudentPersonalRefId);
     Assertion.AssertEquals("Code Type", "Local", sp.Service.CodeType);
     Assertion.AssertEquals("Type", "Related Service", sp.Service.Type);
     // Note: Currently mapping the Service value out in SIF 1.5 does not work as expected
     //Assertion.AssertEquals( "Service/@Code", "ZZZ99987", sp.Service().Code());
 }
예제 #4
0
        public void testStudentPlacementMapping()
        {
            StudentPlacement sp       = new StudentPlacement();
            Mappings         mappings = fCfg.Mappings.GetMappings("Default");
            IDictionary      map      = buildIDictionaryForStudentPlacementTest();
            StringMapAdaptor sma      = new StringMapAdaptor(map);

            mappings.MapOutbound(sma, sp);

            sp = (StudentPlacement)AdkObjectParseHelper.WriteParseAndReturn(sp, fVersion);

            // Assert that the StudentPlacement object was mapped correctly
            assertStudentPlacement(sp);

            // Now, map the StudentPlacement back to a hashmap and assert it
            IDictionary restoredData = new Hashtable();

            sma = new StringMapAdaptor(restoredData);
            mappings.MapInbound(sp, sma);
            assertMapsAreEqual(map, restoredData);
        }
예제 #5
0
        public void StudentPlacementMapping()
        {
            StudentPlacement sp       = new StudentPlacement();
            Mappings         mappings = fCfg.Mappings.GetMappings("Default");
            IDictionary      map      = buildIDictionaryForStudentPlacementTest();
            StringMapAdaptor sma      = new StringMapAdaptor(map);

            mappings.MapOutbound(sma, sp);

            SifWriter writer = new SifWriter(Console.Out);

            writer.Write(sp);
            writer.Flush();

            // Assert that the StudentPersonal object was mapped correctly
            assertStudentParticipation(sp);

            // Now, map the student personal back to a hashmap and assert it
            IDictionary      restoredData = new HybridDictionary();
            StringMapAdaptor restorer     = new StringMapAdaptor(restoredData);

            mappings.MapInbound(sp, restorer);
            assertDictionariesAreEqual(map, restoredData);
        }
예제 #6
0
 protected abstract void assertStudentPlacement(StudentPlacement sp);
예제 #7
0
 protected override void assertStudentPlacement(StudentPlacement sp)
 {
     Assertion.AssertEquals("RefID", "0000000000000000", sp.RefId);
     Assertion.AssertEquals("StudentPersonalRefid", "0000000000000000", sp.StudentPersonalRefId);
     Assertion.AssertEquals("Service/@Code", "ZZZ99987", sp.Service.Code);
 }