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)));
        }
        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)));
        }
        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)));
        }
        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)));
        }
Example #5
0
 public object Clone()
 {
     return(new ConsoleSkin
     {
         ConsoleBackground = ConsoleBackground,
         HighlightColor = HighlightColor,
         CursorColor = CursorColor,
         AutoCompleteBorder = AutoCompleteBorder,
         AutoCompleteSelectedTextColor = AutoCompleteSelectedTextColor,
         ScrollBarColor = ScrollBarColor,
         ScrollBarStripColor = ScrollBarStripColor,
         ScrollBarPadding = ScrollBarPadding,
         ScrollBarWidth = ScrollBarWidth,
         CursorWidth = CursorWidth,
         CursorBlinkSpeed = CursorBlinkSpeed,
         HistoryTimeColor = HistoryTimeColor,
         HistoryWarningColor = HistoryWarningColor,
         InputField = (FieldSkin)InputField.Clone(),
         HistoryField = (FieldSkin)HistoryField.Clone(),
         AutoCompleteField = (FieldSkin)AutoCompleteField.Clone()
     });
 }