public void TestCoreStandardFromIdentifier()
        {
            StandardIdentifier identifier = StandardIdentifierTranslation.StandardStringToStandardIdentifier(elaStandardString);
            var coreStandardsRowCcss      = ImmutableArray.Create(
                CoreStandardsRow.Create(
                    subjectCode: "ELA",
                    key: "3-l|4-6|6.SL.2",
                    name: "",
                    description: "CCSS Desc",
                    levelType: "CCSS",
                    identifier: identifier));

            var coreStandardsRowTarget = ImmutableArray.Create(
                CoreStandardsRow.Create(
                    subjectCode: "ELA",
                    key: "4-6|3-6",
                    name: "",
                    description: "Target Desc",
                    levelType: "Target",
                    identifier: identifier));

            CoreStandardsXml coreStandardsXml = new CoreStandardsXml(coreStandardsRowTarget, coreStandardsRowCcss);
            CoreStandards    core             = StandardIdentifierTranslation.CoreStandardFromIdentifier(coreStandardsXml, identifier);

            Assert.NotNull(core);
            Assert.Equal(core.CommonCoreStandardsId, "6.SL.2");
            Assert.Equal(core.TargetId, "4-6");
            Assert.Equal(core.TargetIdLabel, "4");
            Assert.Equal(core.TargetDescription, "Target Desc");
            Assert.Equal(core.CommonCoreStandardsDescription, "CCSS Desc");
        }
        private static CoreStandardsXml LoadCoreStandards(string targetFile)
        {
            var coreDoc = XmlSerialization.GetXDocument(targetFile);

            ImmutableArray <CoreStandardsRow> allRows = coreDoc.Element("Levels").Elements()
                                                        .Select(t => CoreStandardsRow.Create(t))
                                                        .ToImmutableArray();

            var ccss    = allRows.Where(r => r.LevelType == "CCSS").ToImmutableArray();
            var targets = allRows.Where(r => r.LevelType == "Target").ToImmutableArray();

            return(new CoreStandardsXml(
                       targetRows: targets,
                       ccssRows: ccss));
        }
        public void TestToSampleItems()
        {
            var digests = ImmutableArray.Create(digest);
            ImmutableArray <AccessibilityFamilyResource> noPartialResources = ImmutableArray.Create <AccessibilityFamilyResource>();
            var subjectMath = ImmutableArray.Create("MATH");
            AccessibilityFamily noPartialResourcesFamily = new AccessibilityFamily(
                subjects: subjectMath,
                grades: GradeLevels.Grade5,
                resources: noPartialResources);

            MergedAccessibilityFamily resourceFamily = AccessibilityResourceTranslation.MergeGlobalResources(noPartialResourcesFamily, Resources);
            var resourceFamilies = ImmutableArray.Create(resourceFamily);

            Claim1 = new Claim("claim1", "1", "ELA Claim 1");
            Claim2 = new Claim("claim2", "2", "3");
            ItMath = new InteractionType("2", "EQ", "", 2);
            ItEla  = new InteractionType("1", "WER", "", 1);
            Math   = Subject.Create("MATH", "Mathematics", "Math", ImmutableArray.Create(Claim2), ImmutableArray.Create(ItMath.Code));
            Ela    = Subject.Create("ELA", "English", "ELA", ImmutableArray.Create(Claim1), ImmutableArray.Create(ItEla.Code));
            var interactionTypes = ImmutableArray.Create(ItEla, ItMath);
            var subjects         = ImmutableArray.Create(Ela, Math);

            StandardIdentifier identifier = StandardIdentifierTranslation.StandardStringToStandardIdentifier("SBAC-ELA-v1:3-L|4-6|6.SL.2");
            var coreStandardsRowCcss      = ImmutableArray.Create(
                CoreStandardsRow.Create(
                    subjectCode: "ELA",
                    key: "3-l|4-6|6.SL.2",
                    name: "",
                    description: "CCSS Desc",
                    levelType: "CCSS",
                    identifier: identifier));

            var coreStandardsRowTarget = ImmutableArray.Create(
                CoreStandardsRow.Create(
                    subjectCode: "ELA",
                    key: "4-6|3-6",
                    name: "",
                    description: "Target Desc",
                    levelType: "Target",
                    identifier: identifier));

            CoreStandardsXml coreStandardsXml = new CoreStandardsXml(coreStandardsRowTarget, coreStandardsRowCcss);
            var itemPatch       = ImmutableArray.Create(new ItemPatch());
            var brailleFileInfo = new List <BrailleFileInfo>();
            var items           = SampleItemTranslation.ToSampleItems(digests, resourceFamilies, interactionTypes, subjects, coreStandardsXml, itemPatch, brailleFileInfo, appSettings);

            Assert.NotNull(items);
            Assert.Equal(items[0].AccessibilityResourceGroups[0].AccessibilityResources[0].Label, Resources[0].Label);
            Assert.Equal(items[0].AccessibilityResourceGroups[0].AccessibilityResources[0].Order, Resources[0].Order);
            Assert.Equal(items[0].AccessibilityResourceGroups[0].AccessibilityResources[0].ResourceCode, Resources[0].ResourceCode);
            Assert.Equal(items[0].AccessibilityResourceGroups[0].AccessibilityResources[0].ResourceTypeId, Resources[0].ResourceTypeId);
            Assert.Equal(items[0].SufficentEvidenceOfClaim, metadata.Metadata.SufficientEvidenceOfClaim);
            Assert.Equal(items[0].TargetAssessmentType, metadata.Metadata.TargetAssessmentType);
            Assert.Equal(items[0].Grade, GradeLevelsUtils.FromString(digest.GradeCode));
            Assert.Equal(items[0].ItemKey, digest.ItemKey);
            Assert.Equal(items[0].BankKey, digest.BankKey);
            Assert.Equal(items[0].CoreStandards.CommonCoreStandardsDescription, coreStandardsRowCcss[0].Description);
            Assert.Equal(items[0].CoreStandards.TargetDescription, coreStandardsRowTarget[0].Description);
            Assert.Equal(items[0].InteractionType.Code, ItMath.Code);
            Assert.Equal(items[0].InteractionType.Label, ItMath.Label);
            Assert.Equal(items[0].Subject.Code, digest.SubjectCode);
        }