コード例 #1
0
        public void MultipleImpReasonsCanBeInARule()
        {
            var reader     = new BufferedReader("link = { ck3 = ck3Reason imp = impReason imp = impReason2 }");
            var mapper     = new DeathReasonMapper(reader);
            var ck3Reason1 = mapper.GetCK3ReasonForImperatorReason("impReason");
            var ck3Reason2 = mapper.GetCK3ReasonForImperatorReason("impReason2");

            Assert.Equal("ck3Reason", ck3Reason1);
            Assert.Equal("ck3Reason", ck3Reason2);
        }
コード例 #2
0
        public void NonMatchGivesEmptyOptional()
        {
            var reader    = new BufferedReader("link = { ck3 = ck3Reason imp = impReason }");
            var mapper    = new DeathReasonMapper(reader);
            var ck3Reason = mapper.GetCK3ReasonForImperatorReason("nonMatchingReason");

            Assert.Null(ck3Reason);
        }
コード例 #3
0
        public void Ck3ReasonCanBeFound()
        {
            var reader    = new BufferedReader("link = { ck3 = ck3Reason imp = impReason }");
            var mapper    = new DeathReasonMapper(reader);
            var ck3Reason = mapper.GetCK3ReasonForImperatorReason("impReason");

            Assert.Equal("ck3Reason", ck3Reason);
        }
コード例 #4
0
        public void CorrectRuleMatches()
        {
            var input = "link = { ck3 = ck3Reason imp = impReason }\n" +
                        "link = { ck3 = ck3Reason2 imp = impReason2 }";
            var reader     = new BufferedReader(input);
            var mapper     = new DeathReasonMapper(reader);
            var ck3Reason2 = mapper.GetCK3ReasonForImperatorReason("impReason2");

            Assert.Equal("ck3Reason2", ck3Reason2);
        }
コード例 #5
0
        public void MappingsWithNoCK3ReasonAreIgnored()
        {
            var reader = new BufferedReader(
                "link = { imp = impReason }"
                );
            var mapper = new DeathReasonMapper(reader);

            var ck3Reason = mapper.GetCK3ReasonForImperatorReason("impReason");

            Assert.Null(ck3Reason);
        }