public void TestMBpsToBpms() { // parameters dont really matter here DiskSpdManager manager = new DiskSpdManager(1, 40); long oneMBpsToBpms = Convert.ToInt64(1024.00 * 1024.00 / 1000); long twentyMBpsToBpms = Convert.ToInt64(20.00 * 1024 * 1024 / 1000); Assert.AreEqual(oneMBpsToBpms, manager.MBpsToBpms(1)); Assert.AreEqual(twentyMBpsToBpms, manager.MBpsToBpms(20)); }
public void TestComputeOptionParameters() { // parameters dont really matter here DiskSpdManager manager = new DiskSpdManager(1, 40); Dictionary <string, string> expectedValue1 = new Dictionary <string, string>() { { "-w", "23" }, { "-t", "1" }, { "-g", manager.MBpsToBpms(101).ToString() }, { "-d", "100" }, { "-o", "12" }, { "-si", "" }, { "-b", "1024K" }, { "-Sh", "" }, { "-L", "" }, { "-c", "55G" }, { "-a", "g0,0,g1,2,g2,3" }, { "-R", "xml" } }; Dictionary <string, string> expectedValue2 = new Dictionary <string, string>() { { "-w", "22" }, { "-t", "3" }, { "-g", manager.MBpsToBpms(101).ToString() }, { "-d", "123" }, { "-o", "111" }, { "-r", "" }, { "-b", "10K" }, { "-Sh", "" }, { "-L", "" }, { "-c", "165G" }, { "-a", "g0,0,1,2,3" }, { "-R", "xml" } }; CompareDictionararies(expectedValue1, manager.ComputeOptionParameters(23, 101, 1, 100, 12, true, 1024, 55, "g0,0,g1,2,g2,3")); CompareDictionararies(expectedValue2, manager.ComputeOptionParameters(22, 303, 3, 123, 111, false, 10, 165, "g0,0,1,2,3")); }