Beispiel #1
0
        public TestFixture()
        {
            //var format = new Mock<ISecureDataFormat<AuthenticationTicket>>(MockBehavior.Strict);

            //format.Setup(mock => mock.Unprotect(It.Is<string>(token => token == "invalid-token")))
            //    .Returns(value: null);

            //format.Setup(mock => mock.Unprotect(It.Is<string>(token => token == "valid-token")))
            //    .Returns(delegate {
            //        var identity = new ClaimsIdentity(OAuthValidationDefaults.AuthenticationScheme);
            //        identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, "Fabrikam"));

            //        var properties = new AuthenticationProperties();

            //        return new AuthenticationTicket(new ClaimsPrincipal(identity),
            //            properties, OAuthValidationDefaults.AuthenticationScheme);
            //    });

            var builder = new WebHostBuilder()
                          .UseContentRoot(Directory.GetCurrentDirectory())
                          .UseKestrel()
                          .UseStartup <TStartup>()
                          .UseEnvironment("Test");

            _server = new TestServer(builder);

            var client = _server.CreateClient();

            client.BaseAddress = new Uri("http://localhost:5000");
            ApiDriver          = new ApiDriver(client);
        }
Beispiel #2
0
 public Service(ApiDriver apiDriver)
 {
     ApiDriver = apiDriver;
 }
Beispiel #3
0
 public ProviderAssignmentSync(ApiDriver apiDriver)
 {
     this.apiDriver = apiDriver;
 }
 public ProductService(ApiDriver apiDriver) : base(apiDriver) {  }