public void TestewYorkPopulation() { var db = SingletonDatabase.GetInstance(); var population = db.GetPopulation("New York"); Assert.AreEqual(17800000, population); }
public void TestTokyoPopulation() { var db = SingletonDatabase.GetInstance(); var population = db.GetPopulation("Tokyo"); Assert.AreEqual(33200000, population); }
public void IsSingletonTest() { var db = SingletonDatabase.GetInstance(); var db2 = SingletonDatabase.GetInstance(); Assert.That(db, Is.SameAs(db2)); Assert.AreEqual(1, SingletonDatabase.Count); }
public int GetTotalPopulation(IEnumerable <string> names) { int result = 0; foreach (var name in names) { result += SingletonDatabase.GetInstance().GetPopulation(name); } return(result); }