Пример #1
0
        public void ValueCanBeAddedToHistory()
        {
            var cultureField = new HistoryField("culture", initialValue: "greek");

            cultureField.AddValueToHistory("roman", new Date(100, 1, 1));
            Assert.Equal("greek", cultureField.GetValue(new Date(99, 1, 1)));
            Assert.Equal("roman", cultureField.GetValue(new Date(100, 1, 1)));
        }
Пример #2
0
        public void InitialValueCanBeChanged()
        {
            var cultureField = new HistoryField("culture", initialValue: "greek");

            Assert.Equal("greek", cultureField.GetValue(new Date(1, 1, 1)));
            cultureField.InitialValue = "roman";
            Assert.Equal("roman", cultureField.GetValue(new Date(1, 1, 1)));
        }
Пример #3
0
        public void ValueCanBeAddedToHistory()
        {
            var buildingsField = new HistoryField("buildings", initialValue: new List <object> {
                "temple", "aqueduct"
            });

            buildingsField.AddValueToHistory(new List <object> {
                "temple", "brothel", "forum"
            }, new Date(100, 1, 1));
            Assert.Equal(new List <object> {
                "temple", "aqueduct"
            }, buildingsField.GetValue(new Date(99, 1, 1)));
            Assert.Equal(new List <object> {
                "temple", "brothel", "forum"
            }, buildingsField.GetValue(new Date(100, 1, 1)));
        }
Пример #4
0
        public void InitialValueCanBeChanged()
        {
            var buildingsField = new HistoryField("buildings", initialValue: new List <object> {
                "temple", "aqueduct"
            });

            Assert.Equal(new List <object> {
                "temple", "aqueduct"
            }, buildingsField.GetValue(new Date(1, 1, 1)));
            buildingsField.InitialValue = new List <object> {
                "temple", "brothel", "forum"
            };
            Assert.Equal(new List <object> {
                "temple", "brothel", "forum"
            }, buildingsField.GetValue(new Date(1, 1, 1)));
        }