示例#1
0
    public void CoAIsOutputtedForCountryWithFlagSet()
    {
        var titles = new Title.LandedTitles();

        var countries     = new CountryCollection();
        var countryReader = new BufferedReader("tag=ADI flag=testFlag");
        var country       = Country.Parse(countryReader, 1);

        countries.Add(country);

        const string outputModName = "outputMod";
        var          outputPath    = Path.Combine("output", outputModName, "common", "coat_of_arms", "coat_of_arms", "fromImperator.txt");

        SystemUtils.TryCreateFolder(CommonFunctions.GetPath(outputPath));

        titles.ImportImperatorCountries(countries,
                                        new TagTitleMapper(),
                                        new LocDB("english"),
                                        new ProvinceMapper(),
                                        new CoaMapper("TestFiles/imperatorCoAs.txt"),
                                        new GovernmentMapper(),
                                        new SuccessionLawMapper(),
                                        new DefiniteFormMapper(),
                                        new ReligionMapper(),
                                        new CultureMapper(),
                                        new NicknameMapper(),
                                        new CharacterCollection(),
                                        new Date(400, 1, 1)
                                        );

        CoatOfArmsOutputter.OutputCoas(outputModName, titles);

        using var file = File.OpenRead(outputPath);
        var reader = new StreamReader(file);

        Assert.Equal("d_IMPTOCK3_ADI={", reader.ReadLine());
        Assert.Equal("\tpattern=\"pattern_solid.tga\"", reader.ReadLine());
        Assert.Equal("\tcolor1=red color2=green color3=blue", reader.ReadLine());
        Assert.Equal("}", reader.ReadLine());
    }
示例#2
0
    public void CoAIsNotOutputtedForCountryWithoutFlagSet()
    {
        var titles = new Title.LandedTitles();

        var countries     = new CountryCollection();
        var countryReader = new BufferedReader("tag=BDI");
        var country       = Country.Parse(countryReader, 2);

        countries.Add(country);

        const string outputModName = "outputMod";
        var          outputPath    = Path.Combine("output", outputModName, "common", "coat_of_arms", "coat_of_arms", "fromImperator.txt");

        SystemUtils.TryCreateFolder(CommonFunctions.GetPath(outputPath));

        titles.ImportImperatorCountries(countries,
                                        new TagTitleMapper(),
                                        new LocDB("english"),
                                        new ProvinceMapper(),
                                        new CoaMapper("TestFiles/imperatorCoAs.txt"),
                                        new GovernmentMapper(),
                                        new SuccessionLawMapper(),
                                        new DefiniteFormMapper(),
                                        new ReligionMapper(),
                                        new CultureMapper(),
                                        new NicknameMapper(),
                                        new CharacterCollection(),
                                        new Date(400, 1, 1)
                                        );

        CoatOfArmsOutputter.OutputCoas(outputModName, titles);

        using var file = File.OpenRead(outputPath);
        var reader = new StreamReader(file);

        Assert.True(reader.EndOfStream);
    }