Esempio n. 1
0
        public void ToDifferenceString()
        {
            MemoryUsageInfo comparison = new MemoryUsageInfo("Y", new ByteValue(999), new ByteValue(999), new ByteValue(999));
            MemoryUsageInfo usage      = new MemoryUsageInfo("X", new ByteValue(123), new ByteValue(345), new ByteValue(789));

            Assert.That(
                usage.ToDifferenceString(comparison),
                Is.EqualTo(
                    string.Format(
                        "Compared to Y:{0}\tWorking set: {1}{0}\tManaged memory before collect: {2}{0}\tAfter collect: {3}",
                        Environment.NewLine,
                        (new ByteValue(123) - new ByteValue(999)).ToDifferenceString(),
                        (new ByteValue(345) - new ByteValue(999)).ToDifferenceString(),
                        (new ByteValue(789) - new ByteValue(999)).ToDifferenceString()
                        )));
        }