Ejemplo n.º 1
0
        public void VReadVersions()
        {
            foreach (var ent in history.Entries.OfType <ResourceEntry>())
            {
                var identity = new ResourceIdentity(ent.SelfLink);

                var version = client.Read <Patient>(identity);

                if (version == null)
                {
                    TestResult.Fail("Cannot find version that was present in history");
                }

                HttpTests.AssertContentLocationPresentAndValid(client);
                var selfLink = new ResourceIdentity(client.LastResponseDetails.ContentLocation);
                if (String.IsNullOrEmpty(selfLink.Id) || String.IsNullOrEmpty(selfLink.VersionId))
                {
                    TestResult.Fail("Optional Content-Location contains an invalid version-specific url");
                }
            }

            foreach (var ent in history.Entries.OfType <DeletedEntry>())
            {
                var identity = new ResourceIdentity(ent.SelfLink);

                HttpTests.AssertFail(client, () => client.Read <Patient>(identity), HttpStatusCode.Gone);
            }
        }
Ejemplo n.º 2
0
        public void GetTestDataPerson()
        {
            Patient p = NewPatient("Emerald", "Caro");
            ResourceEntry <Patient> entry = client.Create(p, null, false);
            string id = entry.GetBasicId();

            var pat = client.Read <Patient>(id);

            HttpTests.AssertHttpOk(client);

            HttpTests.AssertValidResourceContentTypePresent(client);
            HttpTests.AssertLastModifiedPresent(client);
            HttpTests.AssertContentLocationPresentAndValid(client);
        }