Example #1
0
        public GlobalIntegrationFixture()
        {
            var currentDirPath = Directory.GetCurrentDirectory();
            var dirInfo        = new DirectoryInfo(currentDirPath);

            while (dirInfo != null && !dirInfo.GetFiles("*.sln").Any())
            {
                dirInfo = dirInfo.Parent;
            }
            if (dirInfo == null)
            {
                throw new Exception("tests run outside solution");
            }

            Configuration = new ConfigurationBuilder()
                            .SetBasePath(dirInfo.FullName)
                            .AddJsonFile("Coaches.MainApp/appsettings.json")
                            .Build();

            var logsUrl  = Configuration["AppTrackingURLs:Logs"];
            var eventUrl = Configuration["AppTrackingURLs:Event"];


            FakeHttpService = new FakeHttpService();
            FakeHttpService.AssignGetEndpoint(logsUrl, FakeGetCoachList);
            FakeHttpService.AssignPostEndpoint(eventUrl, FakeSendEvent);
        }
Example #2
0
 public void Dispose()
 {
     FakeHttpService.ClearGetEndpoints();
     FakeHttpService.ClearPostEndpoints();
 }