Пример #1
0
        public void ReturnsTrueWhenFileBytesAreHigherOrEqual_DecimalSize()
        {
            var fileModel = new MockFileInfo(bytes: 512);
            var checker   = new SizeArchiveNecessityChecker(fileModel, 0.5, MemoryUnit.KB);

            var haveToArchive = checker.HaveToArchive();

            Assert.IsTrue(haveToArchive);
        }
Пример #2
0
        public void ReturnsFalseWhenFileBytesAreSmaller_DecimalSize()
        {
            var fileModel = new MockFileInfo(bytes: 511);
            var checker   = new SizeArchiveNecessityChecker(fileModel, 0.5, MemoryUnit.KB);

            var haveToArchive = checker.HaveToArchive();

            Assert.IsFalse(haveToArchive);
        }
Пример #3
0
        public void ReturnsFalseWhenFileBytesAreSmaller()
        {
            foreach (var value in System.Enum.GetValues(typeof(MemoryUnit)))
            {
                var fileModel = new MockFileInfo(bytes: (int)value - 1);
                var checker   = new SizeArchiveNecessityChecker(fileModel, 1, (MemoryUnit)value);

                var haveToArchive = checker.HaveToArchive();
                Assert.IsFalse(haveToArchive);
            }
        }