This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
"tsConfig": "projects/mfe1/tsconfig.app.json", | |
"assets": [ | |
"projects/mfe1/src/favicon.ico", | |
"projects/mfe1/src/assets", | |
{ | |
"glob": "**/*", | |
"input": "projects/common/assets/", | |
"output": "./assets/" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img alt="Logo" width="100px" height="85px" src="../assets/images/logo.png" /> | |
<h1>Angular MFE Host</h1> | |
<a routerLink='/'>Main</a>   | |
<a routerLink='/mfe1'>Link to MFE</a> | |
<router-outlet></router-outlet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
"tsConfig": "projects/host/tsconfig.app.json", | |
"assets": [ | |
"projects/host/src/favicon.ico", | |
"projects/host/src/assets", | |
{ | |
"glob": "**/*", | |
"input": "projects/common/assets/", | |
"output": "./assets/" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestClass] | |
public class CacheServiceTests | |
{ | |
private CacheService _cacheService; | |
private Mock<IConnectionMultiplexer> _mockMuxer; | |
private Mock<IDatabase> _mockRedisDb; | |
public CacheServiceTests() | |
{ | |
_mockMuxer = new Mock<IConnectionMultiplexer>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddControllers(); | |
services.AddMemoryCache(); | |
services.AddSingleton<IConnectionMultiplexer>(provider => ConnectionMultiplexer.Connect("your redis connection string")); | |
services.AddScoped<ICacheService, CacheService>(); | |
services.AddScoped<IWeatherService, WeatherService>(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ApiController] | |
[Route("[controller]")] | |
public class WeatherForecastController : ControllerBase | |
{ | |
private readonly ILogger<WeatherForecastController> _logger; | |
private readonly ICacheService _cacheService; | |
private readonly IWeatherService _weatherService; | |
public WeatherForecastController(ILogger<WeatherForecastController> logger, ICacheService cacheService, IWeatherService weatherService) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WeatherService : IWeatherService | |
{ | |
public WeatherService() | |
{ | |
} | |
public async Task<OpenWeather> GetWeather(string cityName) | |
{ | |
if (string.IsNullOrWhiteSpace(cityName)) | |
throw new ArgumentNullException("Provide city name"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CacheService : ICacheService | |
{ | |
private readonly IConnectionMultiplexer _muxer; | |
private readonly IDatabase _conn; | |
private readonly IMemoryCache _memCache; | |
public CacheService(IConnectionMultiplexer muxer, IMemoryCache memCache) | |
{ | |
_muxer = muxer; | |
_conn = _muxer.GetDatabase(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ApplicationTests | |
{ | |
private const string testAppSettingsFileDirectory = @"C:\test\EscapeMines\EscapeMines.IntegrationTests\TestAppSettings"; | |
private const string binAppSettingsFileDirectoryAndName = @"C:\test\EscapeMines\EscapeMines\bin\Debug\netcoreapp3.1\appsettings.json"; | |
protected Process StartApplication(string testAppSettingsFileName) | |
{ | |
// implementation | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ApplicationTests | |
{ | |
private const string testAppSettingsFileDirectory = @"C:\<path>\<SolutionName>\<IntegrationTestsProject>\TestAppSettings"; | |
private const string binAppSettingsFileDirectoryAndName = @"C:\<path>\<SolutionName>\<ConsoleAppProject>\bin\Debug\netcoreapp3.1\appsettings.json"; | |
protected Process StartApplication(string testAppSettingsFileName) | |
{ | |
File.Copy($"{testAppSettingsFileDirectory}\\{testAppSettingsFileName}", binAppSettingsFileDirectoryAndName, true); | |
ProcessStartInfo processStartInfo = new ProcessStartInfo(); | |
processStartInfo.FileName = @"C:\<path>\<SolutionName>\<ConsoleAppProject>\bin\Debug\netcoreapp3.1\EscapeMines.exe"; |
NewerOlder