Пример #1
0
		public void CalculateBarSizes_CalculatesBarSizesCorrectly()
		{
			var segs1 = new Dictionary<string, IEnumerable<Session>>();
			segs1["0"] = _sessions;

			var segs2 = new Dictionary<string, IEnumerable<Session>>();
			segs2["1"] = _sessions.Where(e => e.Id != "eggs");

			var colors1 = segs1.ToDictionary(kvp => kvp.Key, kvp => Color.Empty);
			var colors2 = segs2.ToDictionary(kvp => kvp.Key, kvp => Color.Empty);

			var barInfo1 = new ChartBarInfo("Narrative", string.Empty, segs1, colors1, colors1);
			var barInfo2 = new ChartBarInfo("Singing", string.Empty, segs2, colors2, colors2);

			ChartBarInfo.CalculateBarSizes(new List<ChartBarInfo> { barInfo1, barInfo2 });

			Assert.AreEqual(100, barInfo1.BarSize);
			Assert.AreEqual(32, barInfo2.BarSize);
		}