Example #1
0
 public static void ShouldBeAbleToCheckTheEqualityBetweenTheSameLink()
 {
     //Arrange
     var link = new Link("stylesheet", new Uri("http://localhost:8080/api"));
     //Act
     //Assert
     Assert.Equal(link, link);
 }
Example #2
0
 public static void ShouldBeABleToTellIfALinkIsAValidLinkModel()
 {
     //Arrange
     var link = new Link("stylesheet", new Uri("http://localhost:8080/api"));
     //Act
     //Assert
     Assert.IsAssignableFrom<Model.Link>(link);
 }
Example #3
0
 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);
 }
Example #4
0
 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);
 }
Example #5
0
 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);
 }
Example #6
0
 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);
 }