Exemple #1
0
        public void ShouldRegisterViews()
        {
            var container = new MockUnityContainer();
            var module    = new TestableServicesModule(container);

            module.InvokeRegisterViewsAndServices();

            Assert.AreEqual(10, container.Types.Count);
            Assert.AreEqual(typeof(NotificationView), container.Types[typeof(INotificationView)]);
            Assert.AreEqual(typeof(NotificationViewPresenter), container.Types[typeof(INotificationViewPresenter)]);
            Assert.AreEqual(typeof(DataServiceFacade), container.Types[typeof(IDataServiceFacade)]);
            Assert.AreEqual(typeof(AssetsDataServiceFacade), container.Types[typeof(IAssetsDataServiceFacade)]);
            Assert.AreEqual(typeof(NoOpEventDataParser), container.Types[typeof(IEventDataParser <EventData>)]);
            Assert.AreEqual(typeof(NoOpEventOffsetParser), container.Types[typeof(IEventDataParser <EventOffset>)]);
            Assert.AreEqual(typeof(ProjectService), container.Types[typeof(IProjectService)]);
            Assert.AreEqual(typeof(TimelineBarRegistry), container.Types[typeof(ITimelineBarRegistry)]);
            Assert.AreEqual(typeof(WVC1CodecPrivateDataParser), container.Types[typeof(ICodecPrivateDataParser)]);
        }
        public void ShouldRegisterViews()
        {
            var configurationService = new MockConfigurationService();
            var container            = new MockUnityContainer();
            var module = new TestableServicesModule(container);

            container.Bag.Add(typeof(IConfigurationService), configurationService);

            configurationService.GetParameterValueReturnFunction = p => "polling";

            module.InvokeRegisterViewsAndServices();

            Assert.AreEqual(17, container.Types.Count);
            Assert.AreEqual(typeof(NotificationView), container.Types[typeof(INotificationView)]);
            Assert.AreEqual(typeof(NotificationViewPresenter), container.Types[typeof(INotificationViewPresenter)]);
            Assert.AreEqual(typeof(DataServiceFacade), container.Types[typeof(IDataServiceFacade)]);
            Assert.AreEqual(typeof(AssetsDataServiceFacade), container.Types[typeof(IAssetsDataServiceFacade)]);
            Assert.AreEqual(typeof(DefaultEventDataParser), container.Types[typeof(IEventDataParser <EventData>)]);
            Assert.AreEqual(typeof(DefaultEventOffsetParser), container.Types[typeof(IEventDataParser <EventOffset>)]);
            Assert.AreEqual(typeof(ProjectService), container.Types[typeof(IProjectService)]);
            Assert.AreEqual(typeof(TimelineBarRegistry), container.Types[typeof(ITimelineBarRegistry)]);
            Assert.AreEqual(typeof(CodecPrivateDataParser), container.Types[typeof(ICodecPrivateDataParser)]);
            Assert.AreEqual(typeof(CompositeSmoothStreamingCache), container.Types[typeof(ICache)]);
            Assert.AreEqual(typeof(FifoPurgeStrategy), container.Types[typeof(IPurgeStrategy)]);
            Assert.AreEqual(typeof(CacheManager), container.Types[typeof(ICacheManager)]);
            Assert.AreEqual(typeof(XmlKeyboardManagerService), container.Types[typeof(KeyboardManagerService)]);
            Assert.AreEqual(typeof(UserSettingsService), container.Types[typeof(IUserSettingsService)]);
            Assert.AreEqual(typeof(SequenceRegistry), container.Types[typeof(ISequenceRegistry)]);
            Assert.AreEqual(typeof(PollingLogEntryCollection), container.Types[typeof(ILogEntryCollection)]);

            Assert.AreEqual(2, container.MappingInformation.Count);

            Assert.AreEqual(typeof(IsolatedStorageSmoothStreamingCache), container.MappingInformation[typeof(ICache)].Item2);
            Assert.AreEqual("PrimaryCache", container.MappingInformation[typeof(ICache)].Item1);
            Assert.AreEqual(typeof(DefaultKeyboardManagerService), container.MappingInformation[typeof(KeyboardManagerService)].Item2);
            Assert.AreEqual("DefaultKeyboardManager", container.MappingInformation[typeof(KeyboardManagerService)].Item1);
        }