Esempio n. 1
0
        public void CanSaveAList()
        {
            var littledb = new LittleDB("myDatabase");
            var me = new Programmer("alberto");
            var he = new Programmer("marcelo");

            var programers = new List<Programmer>(){me, he};
            littledb.SaveList(programers);

            var programmers = littledb.GetAll<Programmer>();

            Assert.That(programmers.Count, Is.EqualTo(2));
            Assert.That(programmers[0].Name, Is.EqualTo(me.Name));
            Assert.That(programmers[1].Name, Is.EqualTo(he.Name));
        }
Esempio n. 2
0
        public void ItShouldUpdateTheBudgetonInstance()
        {
            var db = new LittleDB("newYorkTryp");

            var threeDaysAgo = DateTime.Today.AddDays(-3);
            var twoDaysAgo = DateTime.Today.AddDays(-2);
            db.SaveList(new List<DateTime>(){threeDaysAgo, twoDaysAgo});

            var budget = new Budget {Daily = 20, Id = 1, Total = 40};
            db.Save(budget);

            var newyorkExpenses = new Tryp(db);
            newyorkExpenses.GetBudget().Total.ShouldBeEquivalentTo(80);
        }