示例#1
0
        public void TrimLeftMoreCharsThanValue()
        {
            // Arrange
            var excpectedKey = ParamValue.Param.token;
            var value        = "test-token";
            var paramValue   = new ParamValue(excpectedKey, value);

            // Act
            var actual = paramValue.TrimLeft(value.Length + 1);

            // Assert
            Assert.IsNull(actual);
        }
示例#2
0
        public void TrimLeftZeroChars()
        {
            // Arrange
            var excpectedKey  = ParamValue.Param.token;
            var expectedValue = "test-token";
            var paramValue    = new ParamValue(excpectedKey, expectedValue);

            // Act
            var actual = paramValue.TrimLeft(0);

            // Assert
            Assert.AreEqual(expectedValue, actual.Value);
            Assert.AreEqual(excpectedKey, actual.Key);
        }
示例#3
0
        public void TrimLeft()
        {
            // Arrange
            var excpectedKey  = ParamValue.Param.token;
            var toTrim        = "asdf";
            var expectedValue = "test-token";
            var paramValue    = new ParamValue(excpectedKey, $"{toTrim}{expectedValue}");

            // Act
            var actual = paramValue.TrimLeft(toTrim.Length);

            // Assert
            Assert.AreEqual(expectedValue, actual.Value);
            Assert.AreEqual(excpectedKey, actual.Key);
        }