Exemple #1
0
        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);
        }
Exemple #2
0
        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());
        }
Exemple #3
0
        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"));
        }
Exemple #4
0
        public void ToString_ReturnsErrorCode()
        {
            var error = new WebDriverErrorCode("code", HttpStatusCode.BadRequest, "test");

            Assert.Equal("code", error.ToString());
        }