Exemple #1
0
        private static void DoTest(string schemaId, string input, string output)
        {
            var appMetadata = MetadataProvider.Application("offering")
                              .ApplyPolicies(new ApplicationMetadataSchemaKey(schemaId), InMemoryUser.TestInstance("test"),
                                             ClientPlatform.Web);
            var metadata     = MetadataProvider.Entity("offering");
            var imacjson     = JObject.Parse(new StreamReader("jsons\\offering\\" + input).ReadToEnd());
            var offeringData = EntityBuilder.BuildFromJson <CrudOperationData>(typeof(CrudOperationData), metadata, null, imacjson, null);

            offeringData.ApplicationMetadata = appMetadata;
            var resultDescription = HapagOfferingLongDescriptionHandler.ParseSchemaBasedLongDescription(offeringData);

            Debug.Write(resultDescription);
            var expectedResult = new StreamReader("jsons\\offering\\descriptionresults\\" + output).ReadToEnd();

            Assert.AreEqual(expectedResult, resultDescription);
        }
        protected override void HandleLongDescription(ServiceIncident webServiceObject, CrudOperationData entity, ApplicationMetadata metadata, bool update)
        {
            var problem = webServiceObject.Problem;

            problem.Description = HapagOfferingLongDescriptionHandler.ParseSchemaBasedLongDescription(entity);
        }