public void Constructor_SetsProperties() { var error = new WebDriverErrorCode("code", HttpStatusCode.BadRequest, "test"); Assert.Equal("code", error.JsonErrorCode); Assert.Equal(HttpStatusCode.BadRequest, error.HttpStatusCode); Assert.Equal("test", error.Message); }
public void GetHashCode_Works() { var invalidArgument = new WebDriverErrorCode( "invalid argument", HttpStatusCode.BadRequest, "The arguments passed to a command are either invalid or malformed."); Assert.Equal(WebDriverErrorCode.InvalidArgument.GetHashCode(), invalidArgument.GetHashCode()); Assert.Equal(invalidArgument.GetHashCode(), WebDriverErrorCode.InvalidArgument.GetHashCode()); Assert.NotEqual(invalidArgument.GetHashCode(), WebDriverErrorCode.InvalidSessionId.GetHashCode()); }
public void Equals_Works() { var invalidArgument = new WebDriverErrorCode( "invalid argument", HttpStatusCode.BadRequest, "The arguments passed to a command are either invalid or malformed."); Assert.True(WebDriverErrorCode.InvalidArgument.Equals(invalidArgument)); Assert.True(invalidArgument.Equals(WebDriverErrorCode.InvalidArgument)); Assert.False(invalidArgument.Equals(WebDriverErrorCode.InvalidSessionId)); Assert.False(invalidArgument.Equals(null)); Assert.False(invalidArgument.Equals("invalid session")); }
public void ToString_ReturnsErrorCode() { var error = new WebDriverErrorCode("code", HttpStatusCode.BadRequest, "test"); Assert.Equal("code", error.ToString()); }