public void FileSystemRepository_RestoreIntegrationTest()
        {
            AppLoggingFactory.Init(new TestLoggerFactory());

            var localStorageRepository = new TestLocalStorageRepository();

            var fileSystemRepository1 = new FileSystemRepository(localStorageRepository);
            var dataFolder            = fileSystemRepository1.CreateFolder(fileSystemRepository1.RootFolder.Key, "data").Result;

            fileSystemRepository1.CreateFile(dataFolder.Key, "drawr.dat").Wait();

            var fileSystemRepository2 = new FileSystemRepository(localStorageRepository);
            var items = fileSystemRepository2.GetDirectory();
        }
Esempio n. 2
0
        public static async Task Main(string[] args)
        {
            var builder = WebAssemblyHostBuilder.CreateDefault(args);

            builder.RootComponents.Add <App>("app");

            builder.Services.AddScoped(sp => new HttpClient {
                BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)
            });
            builder.Services.AddBlazoredLocalStorage();
            builder.Services.AddSingleton(sp => new DialogService());
            builder.Services.AddSingleton(sp => new AlertService());
            builder.Services.AddSingleton(typeof(ModelService));

            builder.Logging.SetMinimumLevel(LogLevel.Error);

            var host = builder.Build();

            AppLoggingFactory.Init(host.Services.GetRequiredService <ILoggerFactory>());

            await host.RunAsync();
        }