Here are the examples of the csharp api Moq.Language.IReturns.Returns(object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
19
Source : DependencyScopeExtensionsTests.cs
with Apache License 2.0
from aspnet
with Apache License 2.0
from aspnet
[Fact]
public void GetService_ReturnsService()
{
_resolverMock.Setup<object>(r => r.GetService(typeof(Service)))
.Returns(_service1)
.Verifiable();
Service actual = _resolver.GetService<Service>();
_resolverMock.Verify();
replacedert.Same(_service1, actual);
}
19
Source : DependencyScopeExtensionsTests.cs
with Apache License 2.0
from aspnet
with Apache License 2.0
from aspnet
[Fact]
public void GetServices_ReturnsServices()
{
var services = new[] { _service1, _service2 };
_resolverMock.Setup<object>(r => r.GetServices(typeof(Service)))
.Returns(services)
.Verifiable();
IEnumerable<Service> actual = _resolver.GetServices<Service>();
_resolverMock.Verify();
replacedert.Equal(services, actual);
}