public StandardIdentifierTranslationTests()
        {
            elaStandardString           = "SBAC-ELA-v1:3-L|4-6|6.SL.2";
            mathv1StandardString        = "SBAC-MA-v1:1|NBT|E-3|a/s|3.NBT.2";
            mathV4StandardString        = "SBAC-MA-v4:1|NS|D-6|m|6.NS.6c";
            mathV5StandardString        = "SBAC-MA-v5:2|NS|D-6|m|6.NS.6c";
            mathV6StandardString        = "SBAC-MA-v6:3|P|TS04|D-6";
            invalidElaStandardString    = "SBAC-ELA-v1:3-L";
            invalidMathV1StandardString = "SBAC-MA-v1:1|NBT||a/s|";
            invalidMathV4StandardString = "SBAC-MA-v4:|NS|D-6||";
            invalidMathV5StandardString = "SBAC-MA-v5:2||||6.NS.6c";
            invalidMathV6StandardString = "SBAC-MA-v6:3|||";
            noClaimString  = "SBAC-ELA-v1|4-6|6.SL.2";
            noTargetString = "SBAC-ELA-v1:3-L||6.SL.2";
            int    testItemKey  = 1;
            int    testItemBank = 2;
            string testGrade    = "5";

            metadata                                    = new ItemMetadata();
            contents                                    = new ItemContents();
            metadata.Metadata                           = new SmarterAppMetadataXmlRepresentation();
            contents.Item                               = new ItemXmlFieldRepresentation();
            metadata.Metadata.ItemKey                   = testItemKey;
            metadata.Metadata.GradeCode                 = testGrade;
            metadata.Metadata.TargetAssessmentType      = "Test target string";
            metadata.Metadata.SufficientEvidenceOfClaim = "Test claim string";
            metadata.Metadata.InteractionType           = "EQ";
            metadata.Metadata.SubjectCode               = "MATH";
            metadata.Metadata.StandardPublications      = new List <StandardPublication>();
            metadata.Metadata.StandardPublications.Add(
                new StandardPublication
            {
                PrimaryStandard = "SBAC-MA-v1:1|NBT|E-3|a/s|3.NBT.2",
                Publication     = "SBAC-MA-v1"
            });

            contents.Item.ItemKey  = testItemKey;
            contents.Item.ItemBank = testItemBank;
            contents.Item.Contents = new List <Content>();

            var interactionTypes = new List <InteractionType>
            {
                new InteractionType(code: "EQ", label: "", description: "", order: 0)
            };

            var subjects = new List <Subject>
            {
                new Subject(
                    code: "MATH",
                    label: string.Empty,
                    shortLabel: string.Empty,
                    claims: ImmutableArray.Create <Claim>(),
                    interactionTypeCodes: ImmutableArray.Create <string>())
            };

            var placeholderText = new RubricPlaceHolderText
            {
                RubricPlaceHolderContains = new string[0],
                RubricPlaceHolderEquals   = new string[0]
            };

            var settings = new SettingsConfig
            {
                SupportedPublications = new string[] { "" }
            };

            appSettings = new AppSettings
            {
                SettingsConfig        = settings,
                RubricPlaceHolderText = placeholderText
            };
        }
        public void TestItemToItemDigest()
        {
            int    testItemKey  = 1;
            int    testItemBank = 2;
            string testGrade    = "5";

            ItemMetadata metadata = new ItemMetadata();
            ItemContents contents = new ItemContents();

            metadata.Metadata                           = new SmarterAppMetadataXmlRepresentation();
            contents.Item                               = new ItemXmlFieldRepresentation();
            metadata.Metadata.ItemKey                   = testItemKey;
            metadata.Metadata.GradeCode                 = testGrade;
            metadata.Metadata.TargetAssessmentType      = "Test target string";
            metadata.Metadata.SufficientEvidenceOfClaim = "Test claim string";
            metadata.Metadata.InteractionType           = "EQ";
            metadata.Metadata.SubjectCode               = "MATH";
            metadata.Metadata.StandardPublications      = new List <StandardPublication>();
            metadata.Metadata.StandardPublications.Add(
                new StandardPublication
            {
                PrimaryStandard = "SBAC-ELA-v1:3-L|4-6|6.SL.2"
            });

            contents.Item.ItemKey  = testItemKey;
            contents.Item.ItemBank = testItemBank;
            contents.Item.Contents = new List <Content>();

            var interactionTypes = new List <InteractionType>
            {
                new InteractionType(code: "EQ", label: "", description: "", order: 0)
            };

            var subjects = new List <Subject>
            {
                new Subject(
                    code: "MATH",
                    label: string.Empty,
                    shortLabel: string.Empty,
                    claims: ImmutableArray.Create <Claim>(),
                    interactionTypeCodes: ImmutableArray.Create <string>())
            };

            var placeholderText = new RubricPlaceHolderText
            {
                RubricPlaceHolderContains = new string[0],
                RubricPlaceHolderEquals   = new string[0]
            };

            var settings = new SettingsConfig
            {
                SupportedPublications = new string[] { "" }
            };

            AppSettings appSettings = new AppSettings
            {
                SettingsConfig        = settings,
                RubricPlaceHolderText = placeholderText
            };


            ItemDigest digest = ItemDigestTranslation.ToItemDigest(metadata, contents, appSettings);

            Assert.Equal(testItemKey, digest.ItemKey);
            Assert.Equal(testItemBank, digest.BankKey);
            Assert.Equal(GradeLevels.Grade5, GradeLevelsUtils.FromString(digest.GradeCode));
            Assert.Equal("Test target string", digest.TargetAssessmentType);
            Assert.Equal("Test claim string", digest.SufficentEvidenceOfClaim);
            Assert.Equal("MATH", digest.SubjectCode);
            Assert.Equal("EQ", digest.InteractionTypeCode);
        }
        public SampleItemTranslationTests()
        {
            rubricEntries = new List <RubricEntry>()
            {
                new RubricEntry
                {
                    Scorepoint = "0",
                    Name       = "TestName",
                    Value      = "TestValue"
                },
                new RubricEntry
                {
                    Scorepoint = "1",
                    Name       = "TestName1",
                    Value      = "TestValue1"
                }
            };

            var sampleResponces = new List <SampleResponse>()
            {
                new SampleResponse()
                {
                    Purpose       = "TestPurpose",
                    ScorePoint    = "0",
                    Name          = "TestName",
                    SampleContent = "TestSampleContent"
                },
                new SampleResponse()
                {
                    Purpose       = "TestPurpose1",
                    ScorePoint    = "1",
                    Name          = "TestName1",
                    SampleContent = "TestSampleContent1"
                }
            };

            rubricSamples = new List <RubricSample>()
            {
                new RubricSample
                {
                    MaxValue        = "MaxVal",
                    MinValue        = "MinVal",
                    SampleResponses = sampleResponces
                },
                new RubricSample
                {
                    MaxValue        = "MaxVal1",
                    MinValue        = "MinVal1",
                    SampleResponses = new List <SampleResponse>()
                }
            };

            rubricList = new RubricList()
            {
                Rubrics       = rubricEntries,
                RubricSamples = rubricSamples
            };

            Resources = new List <AccessibilityResource>
            {
                AccessibilityResource.Create(
                    resourceCode: "ACC1",
                    order: 1,
                    disabled: false,
                    defaultSelection: "ACC1_SEL1",
                    currentSelectionCode:  "ACC1_SEL1",
                    label: "Accessibility 1",
                    description: "Accessibility Selection One",
                    resourceType: "Acc1Type",
                    selections: ImmutableArray.Create(
                        new AccessibilitySelection(
                            code: "ACC1_SEL1",
                            order: 1,
                            disabled: false,
                            label: "Selection 1",
                            hidden: false))),
                AccessibilityResource.Create(
                    resourceCode: "ACC2",
                    order: 2,
                    disabled: false,
                    defaultSelection: "ACC2_SEL2",
                    currentSelectionCode:  "ACC2_SEL2",
                    label: "Accessibility 2",
                    description: "Accessibility Selection Two",
                    resourceType: "Acc2Type",
                    selections: ImmutableArray.Create(
                        new AccessibilitySelection(
                            code: "ACC2_SEL1",
                            order: 1,
                            disabled: false,
                            label: "Selection 1",
                            hidden: false),
                        new AccessibilitySelection(
                            code: "ACC2_SEL2",
                            order: 2,
                            disabled: false,
                            label: "Selection 2",
                            hidden: false)))
            };

            accessibilityType       = new AccessibilityType();
            accessibilityType.Id    = "Acc1Type";
            accessibilityType.Label = "Accessibility 1";
            accessibilityType.Order = 1;

            int    testItemKey  = 1;
            int    testItemBank = 2;
            string testGrade    = "5";

            metadata                                    = new ItemMetadata();
            contents                                    = new ItemContents();
            metadata.Metadata                           = new SmarterAppMetadataXmlRepresentation();
            contents.Item                               = new ItemXmlFieldRepresentation();
            metadata.Metadata.ItemKey                   = testItemKey;
            metadata.Metadata.GradeCode                 = testGrade;
            metadata.Metadata.TargetAssessmentType      = "Test target string";
            metadata.Metadata.SufficientEvidenceOfClaim = "Test claim string";
            metadata.Metadata.InteractionType           = "2";
            metadata.Metadata.SubjectCode               = "MATH";
            metadata.Metadata.MaximumNumberOfPoints     = 2;
            metadata.Metadata.StandardPublications      = new List <StandardPublication>();
            metadata.Metadata.StandardPublications.Add(
                new StandardPublication
            {
                PrimaryStandard = "SBAC-ELA-v1:3-L|4-6|6.SL.2",
                Publication     = "SupportedPubs"
            });

            contents.Item.ItemKey  = testItemKey;
            contents.Item.ItemBank = testItemBank;
            contents.Item.Contents = new List <Content>();
            var placeholderText = new RubricPlaceHolderText
            {
                RubricPlaceHolderContains = new string[] { "RubricSampleText", "RubricSampleText1" },
                RubricPlaceHolderEquals   = new string[0]
            };

            settings = new SettingsConfig
            {
                SupportedPublications = new string[] { "SupportedPubs" },
                AccessibilityTypes    = new List <AccessibilityType>()
                {
                    accessibilityType
                },
                InteractionTypesToItem       = new Dictionary <string, string>(),
                DictionarySupportedItemTypes = new List <string>(),
                LanguageToLabel = new Dictionary <string, string>()
            };

            appSettings = new AppSettings
            {
                SettingsConfig        = settings,
                RubricPlaceHolderText = placeholderText
            };

            digest = ItemDigestTranslation.ToItemDigest(metadata, contents, appSettings);
        }