public static void ShouldBeAbleToCheckTheEqualityBetweenTheSameLink() { //Arrange var link = new Link("stylesheet", new Uri("http://localhost:8080/api")); //Act //Assert Assert.Equal(link, link); }
public static void ShouldBeABleToTellIfALinkIsAValidLinkModel() { //Arrange var link = new Link("stylesheet", new Uri("http://localhost:8080/api")); //Act //Assert Assert.IsAssignableFrom<Model.Link>(link); }
public static void ShouldBeAbleToTellTwoDifferentLinks() { //Arrange var link1 = new Link("stylesheet", new Uri("http://localhost:8080/api")); var link2 = new Link("stylesheet", new Uri("http://localhost:8090/api")); //Act //Assert Assert.NotEqual(link1, link2); }
public static void ShouldBeAbleToCheckIfTwoLinksWithTheSameValuesAreEqual() { //Arrange var link1 = new Link("stylesheet", new Uri("http://localhost:8080/api")); var link2 = new Link("stylesheet", new Uri("http://localhost:8080/api")); //Act //Assert Assert.Equal(link1, link2); }
public static void ShouldBeABleToCreateANewLinkWithDefaultProperties() { //Arrange var link = new Link("stylesheet", new Uri("http://localhost:8080/api")); //Act //Assert Assert.Equal(new Uri("http://localhost:8080/api"), link.Href); Assert.Equal("stylesheet", link.Rel); }
public static void ShouldBeAbleToSerializeToJsonALinkWithDefaultProperties() { //Arrange var link = new Link("stylesheet", new Uri("http://localhost:8080/api")); var expectedAnswer = "{\"rel\":\"stylesheet\",\"href\":\"http://localhost:8080/api\"}"; //Act var realAnswer = JsonConvert.SerializeObject(link); //Assert Assert.Equal(expectedAnswer, realAnswer); }