Skip to content

Commit

Permalink
Removed Tag URIs
Browse files Browse the repository at this point in the history
  • Loading branch information
iansrobinson committed Oct 5, 2011
1 parent af682b6 commit 2f36636
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 66 deletions.
Expand Up @@ -45,7 +45,6 @@ public HttpResponseMessage<SyndicationFeed> Get(string id, HttpRequestMessage re

var feed = new SyndicationFeed
{
Id = "tag:restinpractice.com,2011-09-05:/encounters/" + encounter.Id,
BaseUri = BaseUri,
Title = SyndicationContent.CreatePlaintextContent(encounter.Title),
Description = SyndicationContent.CreatePlaintextContent(encounter.Description)
Expand All @@ -70,7 +69,6 @@ public HttpResponseMessage<SyndicationFeed> Get(string id, HttpRequestMessage re
{
var entry = new SyndicationItem
{
Id = string.Format("tag:restinpractice.com,2011-09-05:/encounters/{0}/rounds/{1}", encounter.Id, round.Id),
Title = SyndicationContent.CreatePlaintextContent("Round " + round.Id),
Summary = SyndicationContent.CreatePlaintextContent(string.Format("The {0} has {1} Endurance Points", encounter.Title, round.Endurance))
};
Expand Down Expand Up @@ -117,7 +115,6 @@ public HttpResponseMessage<SyndicationItem> Post(string id, HttpRequestMessage r

var entry = new SyndicationItem
{
Id = string.Format("tag:restinpractice.com,2011-09-05:/encounters/{0}/rounds/{1}", encounter.Id, round.Id),
BaseUri = BaseUri,
Title = SyndicationContent.CreatePlaintextContent("Round " + round.Id),
Summary = SyndicationContent.CreatePlaintextContent(string.Format("The {0} has {1} Endurance Point{2}", encounter.Title, round.Endurance, Math.Abs(round.Endurance).Equals(1) ? "" : "s")),
Expand Down
Expand Up @@ -47,7 +47,6 @@ public HttpResponseMessage<SyndicationItem> Get(string id, HttpRequestMessage re

var entry = new SyndicationItem
{
Id = "tag:restinpractice.com,2011-09-05:/rooms/" + room.Id,
BaseUri = new Uri("http://" + Environment.MachineName + ":8081"),
Title = SyndicationContent.CreatePlaintextContent(room.Title),
Summary = SyndicationContent.CreatePlaintextContent(room.Description)
Expand Down
Expand Up @@ -68,19 +68,6 @@ public void ResponseContentTypeShouldBeAtomMediaTypeWithEntryTypeParameter()
Assert.AreEqual(AtomMediaType.Entry, response.Content.Headers.ContentType);
}

[Test]
public void ItemIdShouldBeTagUri()
{
var room = CreateRoom();
var resource = CreateRoomResource(room);
var response = resource.Get(room.Id.ToString(), CreateRequest(room.Id));
var item = response.Content.ReadAsOrDefault();

var expectedId = string.Format("tag:restinpractice.com,2011-09-05:/rooms/{0}", room.Id);

Assert.AreEqual(expectedId, item.Id);
}

[Test]
public void ItemTitleShouldReturnRoomTitle()
{
Expand Down
Expand Up @@ -82,19 +82,6 @@ public void FeedShouldContainEncounterCategory()
Assert.IsTrue(feed.Categories.Contains(new SyndicationCategory("encounter"), CategoryComparer.Instance));
}

[Test]
public void FeedIdShouldBeTagUri()
{
var encounter = CreateEncounter();
var resource = CreateEncounterResource(encounter);
var response = resource.Get(encounter.Id.ToString(), CreateRequest(encounter.Id));
var feed = response.Content.ReadAsOrDefault();

var expectedId = string.Format("tag:restinpractice.com,2011-09-05:/encounters/{0}", encounter.Id);

Assert.AreEqual(expectedId, feed.Id);
}

[Test]
public void FeedTitleShouldMatchEncounterTitle()
{
Expand Down Expand Up @@ -205,23 +192,6 @@ public void ItemTitlesShouldIncludeRoundNumberWithMostRecentRoundFirst()
}
}

[Test]
public void EachItemIdShouldBeTagUri()
{
const int numberOfRounds = 3;
var encounter = CreateEncounter(numberOfRounds);

var resource = CreateEncounterResource(encounter);
var response = resource.Get(encounter.Id.ToString(), CreateRequest(encounter.Id));
var feed = response.Content.ReadAsOrDefault();

for (var i = 0; i < numberOfRounds; i++)
{
var expectedId = string.Format("tag:restinpractice.com,2011-09-05:/encounters/{0}/rounds/{1}", encounter.Id, numberOfRounds - i);
Assert.AreEqual(expectedId, feed.Items.ElementAt(i).Id);
}
}

[Test]
public void EachItemShouldHaveASelfLink()
{
Expand Down
Expand Up @@ -94,25 +94,6 @@ public void ItemShouldContainRoundCategory()
Assert.IsTrue(item.Categories.Contains(new SyndicationCategory("round"), CategoryComparer.Instance));
}

[Test]
public void EachItemIdShouldBeTagUri()
{
const int numberOfRounds = 3;
var encounter = CreateEncounter();

var resource = CreateEncounterResource(encounter);

for (var i = 0; i < numberOfRounds; i++)
{
var response = resource.Post(encounter.Id.ToString(), CreateRequest(encounter.Id, CreateFormUrlEncodedContent(ClientEndurance)));
var item = response.Content.ReadAsOrDefault();

var expectedItemId = string.Format("tag:restinpractice.com,2011-09-05:/encounters/{0}/rounds/{1}", encounter.Id, encounter.GetAllRounds().Last().Id);

Assert.AreEqual(expectedItemId, item.Id);
}
}

[Test]
public void ItemShouldIncludeBaseUri()
{
Expand Down

0 comments on commit 2f36636

Please sign in to comment.