private static void AssertContainerContentsEqualTo(ReagentContainer container, ReagentMix expected) { container.Clean(); expected.Clean(); Assert.AreEqual(expected.Count(), container.Count()); foreach (var pair in expected) { var val = container[pair.Key]; Assert.IsTrue(val != null); Assert.AreEqual(pair.Value, val, 0.00000001, $"Wrong amount of {pair.Key}."); } }
private static void AssertContainerContentsEqualTo(ReagentContainer container, ReagentMix expected) { Assert.AreEqual(expected.Count(), container.Count()); foreach (var pair in expected) { var val = container[pair.Key]; if (pair.Key) { Assert.AreEqual(pair.Value, val, 0.00000001, $"Wrong amount of {pair.Key}."); } else { Assert.AreEqual(pair.Value, val, 0.00000001); } } }