/// <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); } ); }
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); }
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(); } }
/// <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"))); } } ); }
public GetValid(WebServerFixture fixture) : base(fixture) { }
public DeleteInvalid(WebServerFixture fixture) : base(fixture) { }
public BaseSubscriptionTest(WebServerFixture fixture) { Fixture = fixture; SubscriptionService = new SubscriptionService(fixture.RestClientNotAuthorize); }
public CreateValid(WebServerFixture fixture) : base(fixture) { }
/// <inheritdoc /> public ConsentControllerIntegrationTests(WebServerFixture fixture, ITestOutputHelper output) : base(fixture, output) { }
public UpdateInvalid(WebServerFixture fixture) : base(fixture) { }
public ListInvalid(WebServerFixture fixture) : base(fixture) { }
/// <inheritdoc /> public ConsentMetaDataControllerTests(WebServerFixture fixture, ITestOutputHelper output) : base(fixture, output) { }