public void Should_Deserialize_Test01() { var list = Resource.Deserialize <RegistryObjectList>("Resources.Models.CooperatingRegistryModel_Test01.xml"); Assert.AreEqual(2, list.Registries.Count); OasisAssert.Registry(list.Registries[0], "urn:xdskit:com:c7ptmx37tfbcwy8ky7a", "urn:xdskit:com:c7ptmx37tfbcwy8ky7b", "3.0", new TimeSpan(2, 0, 0), new TimeSpan(2, 0, 0, 0), "registryLite"); Assert.AreEqual(true, list.Registries[0].ReplicationSyncLatencyValueSpecified); Assert.AreEqual(true, list.Registries[0].CatalogingLatencyValueSpecified); OasisAssert.Registry(list.Registries[1], "urn:xdskit:com:c7ptmx37tfbcwy8ky7d", "urn:xdskit:com:c7ptmx37tfbcwy8ky7e", "3.0", new TimeSpan(1, 0, 0, 0), new TimeSpan(1, 0, 0, 0), "registryFull"); Assert.AreEqual(false, list.Registries[1].ReplicationSyncLatencyValueSpecified); Assert.AreEqual(false, list.Registries[1].CatalogingLatencyValueSpecified); Assert.AreEqual(2, list.Federations.Count); var federation = list.Federations[0]; Assert.AreEqual("urn:xdskit:com:c7ptmx37tfbcwy8ky7g", federation.Id ?? ""); Assert.AreEqual(new TimeSpan(2, 0, 0), federation.ReplicationSyncLatency); Assert.AreEqual(true, federation.ReplicationSyncLatencyValueSpecified); federation = list.Federations[1]; Assert.AreEqual("urn:xdskit:com:c7ptmx37tfbcwy8ky7h", federation.Id ?? ""); Assert.AreEqual(new TimeSpan(1, 0, 0, 0), federation.ReplicationSyncLatency); Assert.AreEqual(false, federation.ReplicationSyncLatencyValueSpecified); Assert.AreEqual(2, list.Associations.Count); OasisAssert.Association(list.Associations[0], "", AssociationType.HasFederationMember, "urn:xdskit:com:c7ptmx37tfbcwy8ky7g", "urn:xdskit:com:c7ptmx37tfbcwy8ky7a"); OasisAssert.Association(list.Associations[1], "", AssociationType.HasFederationMember, "urn:xdskit:com:c7ptmx37tfbcwy8ky7g", "urn:xdskit:com:c7ptmx37tfbcwy8ky7d"); }
public void Should_Deserialize_Test01() { var list = Resource.Deserialize <RegistryObjectList>("Resources.Models.AssociationModel_Test01.xml"); Assert.AreEqual(1, list.RegistryPackages.Count); Assert.AreEqual(2, list.ExtrinsicObjects.Count); Assert.AreEqual(2, list.Associations.Count); OasisAssert.Association(list.Associations[0], "", AssociationType.HasMember, "urn:xdskit:com:c7ptmx37tfbcwy8ky7m", "urn:xdskit:com:c7ptmx37tfbcwy8ky7n"); OasisAssert.Association(list.Associations[1], "", AssociationType.HasMember, "urn:xdskit:com:c7ptmx37tfbcwy8ky7m", "urn:xdskit:com:c7ptmx37tfbcwy8ky7p"); }
public void Should_Deserialize_Test01() { var request = Resource.Deserialize <UpdateObjectsRequest>("Resources.Services.UpdateObjectsRequest_Test01.xml"); Assert.AreEqual("urn:xdskit:com:c7ptmx37tfbcwy8ky7a", request.Id); Assert.AreEqual("This is a comment", request.Comment); Assert.AreEqual(1, request.RegistryObjects.ExtrinsicObjects.Count); var document = request.RegistryObjects.ExtrinsicObjects[0]; OasisAssert.ExtrinsicObject(document, "urn:xdskit:com:Document:c7ptmx37tfbcwy8ky7b", "text/xml", "urn:xdskit:com:c7ptmx37tfbcwy8ky7c", false); Assert.AreEqual(4, document.Slots.Count); OasisAssert.Slot(document.Slots[0], "creationTime", "", new[] { "20051224" }); OasisAssert.Slot(document.Slots[1], "languageCode", "", new[] { "en-us" }); OasisAssert.Slot(document.Slots[2], "serviceStartTime", "", new[] { "200412230800" }); OasisAssert.Slot(document.Slots[3], "serviceStopTime", "", new[] { "200412230801" }); Assert.AreEqual(2, request.RegistryObjects.RegistryPackages.Count); var package = request.RegistryObjects.RegistryPackages[0]; OasisAssert.RegistryPackage(package, "urn:xdskit:com:SubmissionSet:c7ptmx37tfbcwy8ky7d", "Progress Note", "Progress Note for 8/1/2015"); Assert.AreEqual(1, package.Slots.Count); OasisAssert.Slot(package.Slots[0], "submissionTime", "", new[] { "20041225235050" }); Assert.AreEqual(1, package.ExternalIdentifiers.Count); OasisAssert.ExternalIdentifier(package.ExternalIdentifiers[0], "urn:xdskit:com:c7ptmx37tfbcwy8ky7e", "urn:xdskit:com:c7ptmx37tfbcwy8ky7f", "urn:xdskit:com:SubmissionSet:c7ptmx37tfbcwy8ky7d", "T-77012382", "XDSSubmissionSet.patientId", ""); package = request.RegistryObjects.RegistryPackages[1]; OasisAssert.RegistryPackage(package, "urn:xdskit:com:Folder:c7ptmx37tfbcwy8ky7g", "Progress Notes", ""); Assert.AreEqual(3, request.RegistryObjects.Associations.Count); OasisAssert.Association(request.RegistryObjects.Associations[0], "urn:xdskit:com:c7ptmx37tfbcwy8ky7h", AssociationType.HasMember, "urn:xdskit:com:SubmissionSet:c7ptmx37tfbcwy8ky7d", "urn:xdskit:com:Folder:c7ptmx37tfbcwy8ky7g"); OasisAssert.Association(request.RegistryObjects.Associations[1], "urn:xdskit:com:c7ptmx37tfbcwy8ky7i", AssociationType.HasMember, "urn:xdskit:com:Folder:c7ptmx37tfbcwy8ky7g", "urn:xdskit:com:Document:c7ptmx37tfbcwy8ky7b"); OasisAssert.Association(request.RegistryObjects.Associations[2], "urn:xdskit:com:c7ptmx37tfbcwy8ky7j", AssociationType.HasMember, "urn:xdskit:com:SubmissionSet:c7ptmx37tfbcwy8ky7d", "urn:xdskit:com:Document:c7ptmx37tfbcwy8ky7b"); }
public void Should_Deserialize_Test01() { var list = Resource.Deserialize <RegistryObjectList>("Resources.Models.ProvenanceModel_Test01.xml"); Assert.AreEqual(1, list.Organizations.Count); var org = list.Organizations[0]; Assert.AreEqual("urn:xdskit:com:c7ptmx37tfbcwy8ky7n", org.Id); Assert.AreEqual("https://services.xdskit.com/organizations", org.Home); Assert.AreEqual(0, org.Slots.Count); Assert.NotNull(org.Name); Assert.AreEqual("XdsKit, Inc.", org.Name.GetValue("en-US")); Assert.AreEqual("XdsKit, Inc.", org.Name.GetValue()); Assert.NotNull(org.Description); Assert.AreEqual("Main XdsKit organization record", org.Description.GetValue("en-US")); Assert.AreEqual("Main XdsKit organization record", org.Description.GetValue()); Assert.IsNull(org.VersionInfo); Assert.AreEqual(0, org.Classifications.Count); Assert.AreEqual(0, org.ExternalIdentifiers.Count); Assert.IsNullOrEmpty(org.LocalId); Assert.IsNullOrEmpty(org.ObjectType); Assert.IsNullOrEmpty(org.Status); Assert.IsNullOrEmpty(org.Parent); Assert.AreEqual("urn:xdskit:com:c7ptmx37tfbcwy8ky7m", org.PrimaryContact); Assert.AreEqual(2, org.Addresses.Count); OasisAssert.PostalAddress(org.Addresses[0], "123", "Sesame St", "New York", "NY", "10212", "US"); OasisAssert.PostalAddress(org.Addresses[1], "400", "Principal Way", "Philadelphia", "PA", "19101", "US"); Assert.AreEqual(3, org.TelephoneNumbers.Count); OasisAssert.Telephone(org.TelephoneNumbers[0], "1", "513", "555-1212", "", "Home"); OasisAssert.Telephone(org.TelephoneNumbers[1], "44", "212", "555-3000", "2010", "Work"); OasisAssert.Telephone(org.TelephoneNumbers[2], "2", "212", "555-8080", "30", "Fax"); Assert.AreEqual(1, org.EmailAddresses.Count); OasisAssert.Email(org.EmailAddresses[0], "*****@*****.**", "Company"); Assert.AreEqual(1, list.Persons.Count); var person = list.Persons[0]; Assert.AreEqual("urn:xdskit:com:c7ptmx37tfbcwy8ky7m", person.Id); Assert.AreEqual("https://services.xdskit.com/person", person.Home); Assert.AreEqual(0, person.Slots.Count); Assert.NotNull(person.Name); Assert.AreEqual("Michael Haboustak", person.Name.GetValue("en-AU")); Assert.AreEqual(null, person.Name.GetValue()); Assert.NotNull(person.Description); Assert.AreEqual("This object represents an ebRIM person", person.Description.GetValue("en-GB")); Assert.AreEqual(null, person.Description.GetValue()); Assert.IsNull(person.VersionInfo); Assert.AreEqual(0, person.Classifications.Count); Assert.AreEqual(0, person.ExternalIdentifiers.Count); Assert.IsNullOrEmpty(person.LocalId); Assert.IsNullOrEmpty(person.ObjectType); Assert.IsNullOrEmpty(person.Status); Assert.AreEqual("Michael", person.PersonName.FirstName); Assert.AreEqual("M", person.PersonName.MiddleName); Assert.AreEqual("Haboustak", person.PersonName.LastName); Assert.AreEqual(2, person.Addresses.Count); OasisAssert.PostalAddress(person.Addresses[0], "123", "Sesame St", "New York", "NY", "10212", "US"); OasisAssert.PostalAddress(person.Addresses[1], "400", "Principal Way", "Philadelphia", "PA", "19101", "US"); Assert.AreEqual(3, person.TelephoneNumbers.Count); OasisAssert.Telephone(person.TelephoneNumbers[0], "1", "513", "555-1212", "1040", "Home"); OasisAssert.Telephone(person.TelephoneNumbers[1], "44", "212", "555-3000", "2010", "Work"); OasisAssert.Telephone(person.TelephoneNumbers[2], "2", "212", "555-8080", "30", "Fax"); Assert.AreEqual(1, list.Users.Count); var user = list.Users[0]; Assert.AreEqual("urn:xdskit:com:c7ptmx37tfbcwy8ky7p", user.Id); Assert.AreEqual("https://services.xdskit.com/user", user.Home); Assert.AreEqual(0, user.Slots.Count); Assert.NotNull(user.Name); Assert.AreEqual("Mike Haboustak", user.Name.GetValue("en-US")); Assert.AreEqual("Mike Haboustak", user.Name.GetValue()); Assert.NotNull(user.Description); Assert.AreEqual("This object represents an ebRIM user", user.Description.GetValue("en-US")); Assert.AreEqual("This object represents an ebRIM user", user.Description.GetValue()); Assert.IsNull(user.VersionInfo); Assert.AreEqual(0, user.Classifications.Count); Assert.AreEqual(0, user.ExternalIdentifiers.Count); Assert.IsNull(user.LocalId); Assert.IsNull(user.ObjectType); Assert.IsNull(user.Status); Assert.AreEqual("Mike", user.PersonName.FirstName); Assert.AreEqual("M", user.PersonName.MiddleName); Assert.AreEqual("Haboustak", user.PersonName.LastName); Assert.AreEqual(2, user.Addresses.Count); OasisAssert.PostalAddress(user.Addresses[0], "123", "Sesame St", "New York", "NY", "10212", "US"); OasisAssert.PostalAddress(user.Addresses[1], "400", "Principal Way", "Philadelphia", "PA", "19101", "US"); Assert.AreEqual(3, user.TelephoneNumbers.Count); OasisAssert.Telephone(user.TelephoneNumbers[0], "1", "513", "555-1212", "1040", "Home"); OasisAssert.Telephone(user.TelephoneNumbers[1], "44", "212", "555-3000", "2010", "Work"); OasisAssert.Telephone(user.TelephoneNumbers[2], "2", "212", "555-8080", "30", "Fax"); Assert.AreEqual(2, list.Associations.Count); OasisAssert.Association(list.Associations[0], "urn:xdskit:com:c7ptmx37tfbcwy8ky7o", AssociationType.AffiliatedWith, list.Persons[0].Id, list.Organizations[0].Id); OasisAssert.Association(list.Associations[1], "urn:xdskit:com:c7ptmx37tfbcwy8ky7q", AssociationType.AffiliatedWith, list.Users[0].Id, list.Organizations[0].Id); }