Пример #1
0
        public void DateBased_Should_Return_Correct_Path()
        {
            var dateBasedBasedDynamicFolderResolver = new DateBasedDynamicFolderResolver()
            {
                Format = "dd/MM/yyyy"
            };
            var testItem = new TestItem(new DateTime(1998, 12, 23, 12, 23, 23));

            var bucket = new BucketItemTest();
            var result = dateBasedBasedDynamicFolderResolver.GetFolderPath(testItem, bucket, DateTime.Now);

            result.ShouldEqual("23/12/1998");
        }
        public void Should_Return_Same_Object()
        {
            var testDynamicFolderPath = new TestDynamicFolderPath();
            var switcher = new DynamicFolderSwitcher(new DynamicFolderCache(), new TestObjectCreator <IDynamicFolderResolver>(testDynamicFolderPath));
            var bucket   = new BucketItemTest()
            {
                Id = Guid.NewGuid(), DynamicFolderPath = new TestTypeDefinition(testDynamicFolderPath)
            };

            var result1 = switcher.GetFolderPathResolver(bucket);
            var result2 = switcher.GetFolderPathResolver(bucket);

            result1.ShouldImplement <IDynamicFolderResolver>();
            result1.ShouldBeSameAs(result2);
        }
Пример #3
0
        public void Guid_Should_Return_Correct_Path()
        {
            var guidBasedDynamicFolderResolver = new GuidBasedDynamicFolderResolver()
            {
                Depth = "5"
            };
            var testItem = new TestItem()
            {
                Id = new Guid("1d8e49ca-2a02-4b78-8339-6e6bf8bf5687")
            };

            var bucket = new BucketItemTest();
            var result = guidBasedDynamicFolderResolver.GetFolderPath(testItem, bucket, DateTime.Now);

            result.ShouldEqual("1/d/8/e/4");
        }