Exemplo n.º 1
0
 /// <inheritdoc />
 public WebIntegrationTest(WebServerFixture fixture, ITestOutputHelper output)
 {
     Fixture        = fixture;
     Output         = output;
     fixture.Output = output;
     Server         = fixture.Server;
     ApiClient      = fixture.ApiClient;
     AddData(
         c =>
     {
         c.Database.EnsureDeleted();
         c.Database.Migrate();
         return(0);
     });
     AddData(
         ctx =>
     {
         ctx.AddRange(
             Identifiers.Registry.Cast <Common.Identity.Identifiers.IdentifierDefinition>()
             .Select(_ => new IdentifierDefinitionEntity(_.Name, _.ToDefinition()))
             );
         ctx.AddRange(
             KnownEvidence.Registry.Cast <EvidenceDefinition>()
             .Tap(_ => output.WriteLine("Adding evidence {0}, {1}", _.Name, _.ToDefinition()))
             .Select(_ => new EvidenceDefinitionEntity(_.Name, _.ToDefinition()))
             );
         return(0);
     }
         );
 }
Exemplo n.º 2
0
        public void Setup()
        {
            (this._app, this._assembly) = WebServerFixture.CreateNewServer();
            var listenUrl = "http://localhost:4550";

            this._sharpBoss = new SharpBoss(listenUrl);
            this._sharpBoss.Run();
            this._client = new RestClient(listenUrl);
        }
Exemplo n.º 3
0
        public void TestListenUrlFromConfigWithoutSlash()
        {
            var listenUrl   = "http://localhost:2122";
            var appSettings = WebServerFixture.CreateConfigFile(listenUrl);

            this._sharpBoss = new SharpBoss(appSettings: appSettings);

            Assert.NotNull(this._sharpBoss);
            Assert.AreEqual(listenUrl + "/", this._sharpBoss.GetHttpServerListenUrl());
        }
        public GalleryContextShould(WebServerFixture fixture)
        {
            server = fixture.Server;

            // Testing with InMemory
            // https://docs.microsoft.com/en-us/ef/core/miscellaneous/testing/in-memory
            options = new DbContextOptionsBuilder <GalleryContext>()
                      .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString())
                      .Options;

            using (var ctx = new GalleryContext(options))
            {
                ctx.Database.EnsureDeleted();
                ctx.Database.EnsureCreated();
            }
        }
Exemplo n.º 5
0
 /// <inheritdoc />
 public ApiClientTests(ITestOutputHelper output, WebServerFixture fixture) : base(fixture, output)
 {
     AddData(
         context =>
     {
         if (context.Set <AuthorityEntity>().Any(_ => _.SystemName == "medway"))
         {
             return(null);
         }
         lock (Sync)
         {
             if (context.Set <AuthorityEntity>().Any(_ => _.SystemName == "medway"))
             {
                 return(null);
             }
             output.WriteLine($"Creating Medway Authority");
             return(context.Add(new AuthorityEntity("Medway", 150, "medway")));
         }
     }
         );
 }
Exemplo n.º 6
0
 public GetValid(WebServerFixture fixture) : base(fixture)
 {
 }
Exemplo n.º 7
0
 public DeleteInvalid(WebServerFixture fixture)
     : base(fixture)
 {
 }
Exemplo n.º 8
0
 public BaseSubscriptionTest(WebServerFixture fixture)
 {
     Fixture             = fixture;
     SubscriptionService = new SubscriptionService(fixture.RestClientNotAuthorize);
 }
Exemplo n.º 9
0
 public CreateValid(WebServerFixture fixture)
     : base(fixture)
 {
 }
 /// <inheritdoc />
 public ConsentControllerIntegrationTests(WebServerFixture fixture, ITestOutputHelper output) : base(fixture, output)
 {
 }
Exemplo n.º 11
0
 public UpdateInvalid(WebServerFixture fixture)
     : base(fixture)
 {
 }
Exemplo n.º 12
0
 public ListInvalid(WebServerFixture fixture) : base(fixture)
 {
 }
 /// <inheritdoc />
 public ConsentMetaDataControllerTests(WebServerFixture fixture, ITestOutputHelper output) : base(fixture, output)
 {
 }