Beispiel #1
0
        private void RegisterSpecificDependencies()
        {
            var registry = new ViewModelMetadataRegistry();

            registry.LoadViewModelMetadataInAssemblyOf <ViewModelMapperToDictionary>();
            Container.Use <IViewModelMetadataRegistry>(registry);
        }
Beispiel #2
0
        private void InitMetadataRegistry()
        {
            var registry = new ViewModelMetadataRegistry();

            registry.LoadViewModelMetadataInAssemblyOf <ViewModelMapperMapTo>();
            Container.Use <IViewModelMetadataRegistry>(registry);
        }
Beispiel #3
0
        public void SetUp()
        {
            Container = new AutoMocker();

            var registry = new ViewModelMetadataRegistry();

            registry.LoadViewModelMetadataInAssemblyOf(GetType().Assembly);
            Container.Use <IViewModelMetadataRegistry>(registry);
        }
        internal static IViewModelMapper CreateFake(params Assembly[] assemblies)
        {
            var registry = new ViewModelMetadataRegistry();

            foreach (var assembly in assemblies)
            {
                registry.LoadViewModelMetadataInAssemblyOf(assembly);
            }

            var formatterMock = new Mock <IViewModelPropertyFormatter>();

            formatterMock.Setup(m => m.Format(It.IsAny <object>(), It.IsNotNull <IPropertyMetadata>(), It.IsAny <CultureInfo>()))
            .Returns((object value, IPropertyMetadata meta, CultureInfo culture) => value == null ? null : value.ToString());

            var lookupServiceMock        = new Mock <ILookupService>();
            var localizationProviderMock = new Mock <ILocalizationProvider>();

            var mapper = new ViewModelMapper(registry, formatterMock.Object, lookupServiceMock.Object, localizationProviderMock.Object);

            return(mapper);
        }