Implement `OwinEnvironment` `IEnumerable.GetEnumerator()` (#789)
This commit is contained in:
parent
fc3af1ecfe
commit
1b02cd2baf
|
|
@ -270,7 +270,7 @@ namespace Microsoft.AspNetCore.Owin
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator<KeyValuePair<string, object>> IEnumerable<KeyValuePair<string, object>>.GetEnumerator()
|
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
|
||||||
{
|
{
|
||||||
foreach (var entryPair in _entries)
|
foreach (var entryPair in _entries)
|
||||||
{
|
{
|
||||||
|
|
@ -288,7 +288,7 @@ namespace Microsoft.AspNetCore.Owin
|
||||||
|
|
||||||
IEnumerator IEnumerable.GetEnumerator()
|
IEnumerator IEnumerable.GetEnumerator()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
return GetEnumerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class FeatureMap
|
public class FeatureMap
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
@ -129,6 +130,15 @@ namespace Microsoft.AspNetCore.Owin
|
||||||
Assert.Equal("1.0", env["owin.Version"]);
|
Assert.Equal("1.0", env["owin.Version"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void OwinEnvironmentImpelmentsGetEnumerator()
|
||||||
|
{
|
||||||
|
var owinEnvironment = new OwinEnvironment(CreateContext());
|
||||||
|
|
||||||
|
Assert.NotNull(owinEnvironment.GetEnumerator());
|
||||||
|
Assert.NotNull(((IEnumerable)owinEnvironment).GetEnumerator());
|
||||||
|
}
|
||||||
|
|
||||||
private HttpContext CreateContext()
|
private HttpContext CreateContext()
|
||||||
{
|
{
|
||||||
var context = new DefaultHttpContext();
|
var context = new DefaultHttpContext();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue