예제 #1
0
        public void Should_Get_Specified_Name()
        {
            var name = FileContainerNameAttribute
                       .GetContainerName <TestContainer2>();

            Assert.Equal("Test2", name);
        }
예제 #2
0
        public static IFileProvider Get <TContainer>(
            [NotNull] this IFileProviderSelector selector)
        {
            Check.NotNull(selector, nameof(selector));

            return(selector.Get(FileContainerNameAttribute.GetContainerName <TContainer>()));
        }
예제 #3
0
        public void GetName_By_Type()
        {
            var expected = typeof(TestContainer3).FullName;
            var name     = FileContainerNameAttribute.GetContainerName(typeof(TestContainer3));

            Assert.Equal(expected, name);
        }
 public FileContainerConfigurations Configure <TContainer>(
     Action <FileContainerConfiguration> configureAction)
 {
     return(Configure(
                FileContainerNameAttribute.GetContainerName <TContainer>(),
                configureAction
                ));
 }
 public FileContainerConfigurations()
 {
     _containers = new Dictionary <string, FileContainerConfiguration>
     {
         //Add default container
         [FileContainerNameAttribute.GetContainerName <DefaultContainer>()] = new FileContainerConfiguration()
     };
 }
예제 #6
0
        public void Should_Get_Full_Class_Name_If_Not_Specified()
        {
            var expected = typeof(TestContainer1).FullName;

            var name = FileContainerNameAttribute
                       .GetContainerName <TestContainer1>();

            Assert.Equal(expected, name);
        }
 public FileContainerConfiguration GetConfiguration <TContainer>()
 {
     return(GetConfiguration(FileContainerNameAttribute.GetContainerName <TContainer>()));
 }