Example #1
0
        public void ShouldSetExistsToFalseWhenConstructedFromResultWithNotFoundStatus()
        {
            QueryResult <KVPair> kvPairResult = new QueryResult <KVPair>
            {
                StatusCode = HttpStatusCode.NotFound
            };

            var configQueryResult = new ConfigQueryResult(kvPairResult);

            Assert.That(configQueryResult.Exists, Is.False);
        }
Example #2
0
        public void ShouldSetExistsToFalseWhenConstructedFromResultWithNullResponse()
        {
            QueryResult <KVPair> kvPairResult = new QueryResult <KVPair>
            {
                Response   = null,
                StatusCode = HttpStatusCode.OK
            };

            var configQueryResult = new ConfigQueryResult(kvPairResult);

            Assert.That(configQueryResult.Exists, Is.False);
        }
Example #3
0
        public void ShouldSetExistsToFalseWhenConstructedFromResultWithEmptyValue()
        {
            QueryResult <KVPair> kvPairResult = new QueryResult <KVPair>
            {
                Response = new KVPair("Key")
                {
                    Value = new byte[] {}
                },
                StatusCode = HttpStatusCode.OK
            };

            var configQueryResult = new ConfigQueryResult(kvPairResult);

            Assert.That(configQueryResult.Exists, Is.False);
        }
Example #4
0
        public void ShouldSetValueToResultValue()
        {
            var actualValue = new byte[] { 1 };
            QueryResult <KVPair> kvPairResult = new QueryResult <KVPair>
            {
                Response = new KVPair("Key")
                {
                    Value = actualValue
                },
                StatusCode = HttpStatusCode.OK
            };

            var configQueryResult = new ConfigQueryResult(kvPairResult);

            Assert.That(configQueryResult.Value, Is.SameAs(actualValue));
        }
Example #5
0
        public void ShouldSetExistsToFalseWhenConstructedFromNullResult()
        {
            var configQueryResult = new ConfigQueryResult(null);

            Assert.That(configQueryResult.Exists, Is.False);
        }