Пример #1
0
        public virtual void TestToStringNoQuota()
        {
            long           length         = 11111;
            long           fileCount      = 22222;
            long           directoryCount = 33333;
            ContentSummary contentSummary = new ContentSummary.Builder().Length(length).FileCount
                                                (fileCount).DirectoryCount(directoryCount).Build();
            string expected = "        none             inf            none" + "             inf        33333        22222              11111 ";

            Assert.Equal(expected, contentSummary.ToString(true));
        }
Пример #2
0
        public virtual void TestToStringHumanNoShowQuota()
        {
            long           length         = long.MaxValue;
            long           fileCount      = 222222222;
            long           directoryCount = 33333;
            long           quota          = 222256578;
            long           spaceConsumed  = 55555;
            long           spaceQuota     = long.MaxValue;
            ContentSummary contentSummary = new ContentSummary.Builder().Length(length).FileCount
                                                (fileCount).DirectoryCount(directoryCount).Quota(quota).SpaceConsumed(spaceConsumed
                                                                                                                      ).SpaceQuota(spaceQuota).Build();
            string expected = "      32.6 K      211.9 M              8.0 E ";

            Assert.Equal(expected, contentSummary.ToString(false, true));
        }
Пример #3
0
        public virtual void TestToStringHumanWithQuota()
        {
            long           length         = long.MaxValue;
            long           fileCount      = 222222222;
            long           directoryCount = 33333;
            long           quota          = 222256578;
            long           spaceConsumed  = 1073741825;
            long           spaceQuota     = 1;
            ContentSummary contentSummary = new ContentSummary.Builder().Length(length).FileCount
                                                (fileCount).DirectoryCount(directoryCount).Quota(quota).SpaceConsumed(spaceConsumed
                                                                                                                      ).SpaceQuota(spaceQuota).Build();
            string expected = "     212.0 M            1023               1 " + "           -1 G       32.6 K      211.9 M              8.0 E ";

            Assert.Equal(expected, contentSummary.ToString(true, true));
        }
Пример #4
0
        public virtual void TestToString()
        {
            long           length         = 11111;
            long           fileCount      = 22222;
            long           directoryCount = 33333;
            long           quota          = 44444;
            long           spaceConsumed  = 55555;
            long           spaceQuota     = 66665;
            ContentSummary contentSummary = new ContentSummary.Builder().Length(length).FileCount
                                                (fileCount).DirectoryCount(directoryCount).Quota(quota).SpaceConsumed(spaceConsumed
                                                                                                                      ).SpaceQuota(spaceQuota).Build();
            string expected = "       44444          -11111           66665" + "           11110        33333        22222              11111 ";

            Assert.Equal(expected, contentSummary.ToString());
        }