public static void ShouldBeAbleToCheckTheEqualityBetweenTheSameError() { //Arrange var error = new Error() { Code = "404", Title = "Not Found", Message = "Resource Not Found" }; //Act //Assert Assert.Equal(error, error); }
public static void ShouldBeABleToTellIfAnErrorIsAValidErrorModel() { //Arrange var Error = new Error(); //Act //Assert Assert.IsAssignableFrom<Model.Error>(Error); }
public static void ShouldBeAbleToTellTwoDifferentErrors() { //Arrange var error1 = new Error() { Code = "404", Title = "Not Found", Message = "Resource Not Found" }; var error2 = new Error() { Code = "500", Title = "Internal Server Error", Message = "Internal Server Error" }; //Act //Assert Assert.NotEqual(error1, error2); }
public static void ShouldBeAbleToCheckIfTwoErrorsWithTheSameValuesAreEqual() { //Arrange var error1 = new Error() { Code = "404", Title = "Not Found", Message = "Resource Not Found" }; var error2 = new Error() { Code = "404", Title = "Not Found", Message = "Resource Not Found" }; //Act //Assert Assert.Equal(error1, error2); }
public static void ShouldBeABleToCreateANewCollectionWithDefaultProperties() { //Arrange var Error = new Error(); //Act //Assert Assert.Null(Error.Title); Assert.Null(Error.Message); Assert.Null(Error.Code); }
public static void ShouldBeAbleToSerializeToJsonAnError() { //Arrange var error = new Error() { Title = "test error", Message = "test error message", Code = "205" }; var expectedAnswer = "{\"title\":\"test error\",\"code\":\"205\",\"message\":\"test error message\"}"; //Act var realAnswer = JsonConvert.SerializeObject(error); //Assert Assert.Equal(expectedAnswer, realAnswer); }