Ejemplo n.º 1
0
    public LoaderApiTests()
    {
        _testEnvironmoent = new TestEnvironmoent();

        _loader = new Mod.Loader.Loader(true);
        _loader.LoadForCurrentProcess();
    }
Ejemplo n.º 2
0
    public LnlServerHost()
    {
        _testEnvironment = new TestEnvironmoent();

        _loader = new Mod.Loader.Loader(true);
        _loader.LoadForCurrentProcess();

        _host   = LiteNetLibServer.Create(_loader.Logger, _loader.Manager.LoaderApi, new Utils.Server.Configuration.Config());
        _client = new LiteNetLibClient(IPAddress.Loopback, "", _host.Host.Manager.LocalPort);
    }
    public void ReadWriteConfig()
    {
        // Make new config first and backup old.
        var config = TestEnvironmoent.MakeTestConfig();

        // Write and read back the config.
        IConfig <LoaderConfig> .ToPath(config, Paths.LoaderConfigPath);

        var newConfig = IConfig <LoaderConfig> .FromPath(Paths.LoaderConfigPath);

        // Restore old config and assert some members.
        Assert.Equal(config.LoaderPath32, newConfig.LoaderPath32);
        Assert.Equal(config.LoaderPath64, newConfig.LoaderPath64);
        Assert.Equal(config.LauncherPath, newConfig.LauncherPath);
        Assert.Equal(config.Bootstrapper32Path, newConfig.Bootstrapper32Path);
        Assert.Equal(config.Bootstrapper64Path, newConfig.Bootstrapper64Path);
        Assert.Equal(config.GetApplicationConfigDirectory(), newConfig.GetApplicationConfigDirectory());
        Assert.Equal(config.GetPluginConfigDirectory(), newConfig.GetPluginConfigDirectory());
        Assert.Equal(config.GetModConfigDirectory(), newConfig.GetModConfigDirectory());
        Assert.Equal(config.LanguageFile, newConfig.LanguageFile);
        Assert.Equal(config.ThemeFile, newConfig.ThemeFile);
    }