Exemple #1
0
        public void OwinEnvironmentSuppliesDefaultsForMissingRequiredEntries()
        {
            ProtoContext context             = CreateContext();
            IDictionary <string, object> env = new OwinEnvironment(context);

            object value;

            Assert.True(env.TryGetValue("owin.CallCancelled", out value), "owin.CallCancelled");
            Assert.True(env.TryGetValue("owin.Version", out value), "owin.Version");

            Assert.Equal(CancellationToken.None, env["owin.CallCancelled"]);
            Assert.Equal("1.0", env["owin.Version"]);
        }
Exemple #2
0
        public void OwinEnvironmentDoesNotContainEntriesForMissingFeatures(string key)
        {
            ProtoContext context             = CreateContext();
            IDictionary <string, object> env = new OwinEnvironment(context);

            object value;

            Assert.False(env.TryGetValue(key, out value));

            Assert.Throws <KeyNotFoundException>(() => env[key]);

            Assert.False(env.Keys.Contains(key));
            Assert.False(env.ContainsKey(key));
        }