Exemplo n.º 1
0
        public void FirstZeroChars()
        {
            // Arrange
            var excpectedKey = ParamValue.Param.token;
            var value        = "test-token";
            var paramValue   = new ParamValue(excpectedKey, value);

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

            // Assert
            Assert.IsNull(actual);
        }
Exemplo n.º 2
0
        public void FirstMoreCharsThanValue()
        {
            // Arrange
            var excpectedKey  = ParamValue.Param.token;
            var expectedValue = "test-token";
            var paramValue    = new ParamValue(excpectedKey, expectedValue);

            // Act
            var actual = paramValue.First(expectedValue.Length + 1);

            // Assert
            Assert.AreEqual(expectedValue, actual.Value);
            Assert.AreEqual(excpectedKey, actual.Key);
        }
Exemplo n.º 3
0
        public void First()
        {
            // Arrange
            var excpectedKey  = ParamValue.Param.token;
            var expectedValue = "first-";
            var last          = "test-token";
            var paramValue    = new ParamValue(excpectedKey, $"{expectedValue}{last}");

            // Act
            var actual = paramValue.First(expectedValue.Length);

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