public XmlDocument RequestTuitionAmount(XmlDocument request) { XmlDocument response = new XmlDocument(); TuitionAmountRequest tuitionRequest = (new BSTSmartScholarshipSerializer<TuitionAmountRequest>()).Deserialize(request); TuitionAmount amount = TuitionAmounts.FirstOrDefault(ta => ta.StudentNumber.Equals(tuitionRequest.StudentNumber, StringComparison.OrdinalIgnoreCase)); TuitionAmountResponse tuitionResponse = new TuitionAmountResponse() { StudentNumber = amount.StudentNumber, TuitionAmount = amount.Amount }; response = (new BSTSmartScholarshipSerializer<TuitionAmountResponse>()).Serialize(tuitionResponse); return response; }
public void Serialize_TuitionAmountResponse_ValidateSchema_Invalid_StudentNumber() { TuitionAmountResponse response = new TuitionAmountResponse() { StudentNumber = "88634351", TuitionAmount = 4500.00 }; response.StudentNumber = "F"; XmlDocument actual = (new BSTSmartScholarshipSerializer<TuitionAmountResponse>()).Serialize(response); XmlSchemaProvider provider = new XmlSchemaProvider(); actual.Schemas.Add(provider.GetSchemaFromResource("BSTSmartScholarship.Business.Schemas.TuitionAmountResponse.xsd")); actual.Validate(null); }