public UserProfileService(IProfileSettingsService profileSettingsService, IUserProfileProvider userProfileProvider, IUpdateContactFacetsService updateContactFacetsService, IAccountTrackerService accountTrackerService) { this.profileSettingsService = profileSettingsService; this.userProfileProvider = userProfileProvider; this.updateContactFacetsService = updateContactFacetsService; this.accountTrackerService = accountTrackerService; }
public DcsWorldService(IContainer container) { _container = container; _settingsService = container.Resolve <ISettingsService>(); _profileSettingsService = container.Resolve <IProfileSettingsService>(); _profileSettingsService.SelectedProfileChanged += _profileSettingsService_SelectedProfileChanged; }
public void GetProfileShouldReturnFullEditProfileModel(Db db, [Substitute] UserProfile userProfile, [RightKeys("FirstName", "LastName", "Phone", "Interest")] IDictionary <string, string> properties, [Frozen] IProfileSettingsService profileSettingsService, [Frozen] IUserProfileProvider userProfileProvider, [Greedy] UserProfileService userProfileService) { using (db) { var id = new ID(); db.Add(new DbItem("Profile", id) { Fields = { new DbField("FirstName", Templates.UserProfile.Fields.FirstName), new DbField("LastName", Templates.UserProfile.Fields.LastName), new DbField("Phone", Templates.UserProfile.Fields.PhoneNumber), new DbField("Interest", Templates.UserProfile.Fields.Interest) } }); profileSettingsService.GetUserDefaultProfile().Returns(db.GetItem(id)); userProfileProvider.GetCustomProperties(Arg.Any <UserProfile>()).Returns(properties); var result = userProfileService.GetProfile(userProfile); result.FirstName.Should().Be(properties["FirstName"]); result.LastName.Should().Be(properties["LastName"]); result.PhoneNumber.Should().Be(properties["Phone"]); result.Interest.Should().Be(properties["Interest"]); } }
public UserProfileService(IProfileSettingsService profileSettingsService, IUserProfileProvider userProfileProvider, IContactFacetsService contactFacetsService, IAccountTrackerService accountTrackerService) { _profileSettingsService = profileSettingsService; _userProfileProvider = userProfileProvider; _contactFacetsService = contactFacetsService; _accountTrackerService = accountTrackerService; }
public SelectInitialViewportsWizardStepViewModel(IContainer container) : base(container) { _settingsService = container.Resolve <ISettingsService>(); _dcsWorldService = container.Resolve <IDcsWorldService>(); _profileSettingsService = container.Resolve <IProfileSettingsService>(); }
public SettingsController(IContainer container) { _container = container; _dcsWorldService = container.Resolve <IDcsWorldService>(); _settingsService = container.Resolve <ISettingsService>(); _profileSettingsService = container.Resolve <IProfileSettingsService>(); }
public MainWindowViewModel(IContainer container) { _container = container; _eventRegistry = container.Resolve <ApplicationEventRegistry>(); _navigationService = container.Resolve <INavigationService>(); _autoUpdateService = container.Resolve <IAutoUpdateService>(); _profileSettingsService = container.Resolve <IProfileSettingsService>(); _settingsService = container.Resolve <ISettingsService>(); _profileSettingsService.SelectedProfileChanged += OnSelectedProfileChanged; _profileSettingsService.ProfilesChanged += OnProfilesChanged; var pluginNavigationSite = container.Resolve <IPluginNavigationSite>(); ShowPluginCommand.Subscribe(OnShowPlugin); pluginNavigationSite.PluginRegistered += OnPluginRegistered; var files = new List <string>( Directory.GetFiles(ApplicationPaths.WallpaperPath) .Where(s => string.IsNullOrEmpty(_supportedExtensions) || _supportedExtensions.Contains(Path.GetExtension(s)))); if (files.Count == 0) { files.AddRange( Directory.GetFiles( Path.Combine(ApplicationPaths.ApplicationPath, "Resources", "Images", "Wallpaper")) .Where(s => string.IsNullOrEmpty(_supportedExtensions) || _supportedExtensions.Contains(Path.GetExtension(s)))); } var rand = new Random(); while (files.Count > 0) { var index = rand.Next(files.Count); var file = files[index]; files.RemoveAt(index); _images.Add(file); } if (_images.Count > 0) { _slideShowTimer.Interval = TimeSpan.FromMinutes(1); _slideShowTimer.Tick += _timer_Tick; _slideShowTimer.Start(); NextImage(); } SelectProfileCommand.Subscribe(OnSelectProfile); _autoUpdateCheckTimer.Interval = TimeSpan.FromMinutes(30); _autoUpdateCheckTimer.Tick += _autoUpdateCheckTimer_Tick; _autoUpdateCheckTimer.Start(); UpdateProfiles(); }
public SettingsViewModel(IContainer container) { _container = container; _controller = container.Resolve <SettingsController>(); _settingsService = container.Resolve <ISettingsService>(); _profileSettingsService = container.Resolve <IProfileSettingsService>(); _profileSettingsService.SelectedProfileChanged += OnSelectedProfileChanged; }
public void GetEmptyProfileShouldReturnEditProfileWithInterests([Frozen] IEnumerable<string> interests, IProfileSettingsService profileSettingsService, IUserProfileProvider userProfileProvider, [Greedy] UserProfileService userProfileService) { var profile = userProfileService.GetEmptyProfile(); profile.Should().NotBeNull(); profile.FirstName.Should().BeNull(); profile.LastName.Should().BeNull(); profile.Interest.Should().BeNull(); profile.PhoneNumber.Should().BeNull(); profile.InterestTypes.Should().BeEquivalentTo(interests); }
public void SetProfileShouldUpdateUserProfile(Db db, [Substitute] UserProfile userProfile, [Substitute] EditProfile editProfile, [Frozen] IProfileSettingsService profileSettingsService, [Frozen] IUserProfileProvider userProfileProvider, [Greedy] UserProfileService userProfileService) { using (db) { var id = new ID(); db.Add(new DbItem("Profile", id) { Fields = { new DbField("FirstName", Templates.UserProfile.Fields.FirstName), new DbField("LastName", Templates.UserProfile.Fields.LastName), new DbField("Phone", Templates.UserProfile.Fields.PhoneNumber), new DbField("Interest", Templates.UserProfile.Fields.Interest) } }); profileSettingsService.GetUserDefaultProfile().Returns(db.GetItem(id)); userProfileService.SetProfile(userProfile, editProfile); userProfileProvider.Received(1).SetCustomProfile(userProfile, Arg.Is <IDictionary <string, string> >( x => x["FirstName"] == editProfile.FirstName && x["LastName"] == editProfile.LastName && x["Interest"] == editProfile.Interest && x["Phone"] == editProfile.PhoneNumber)); } }
public UserProfileService(IUserProfileProvider userProfileProvider, IProfileSettingsService profileSettingsService) { _userProfileProvider = userProfileProvider; _profileSettingsService = profileSettingsService; }
public void GetInterestsShouldReturnInterests([Frozen] IEnumerable <string> interests, IProfileSettingsService profileSettingsService, IUserProfileProvider userProfileProvider, [Greedy] UserProfileService userProfileService) { userProfileService.GetInterests().Should().BeEquivalentTo(interests); }
public void GetEmptyProfileShouldReturnEditProfileWithInterests([Frozen] IEnumerable <string> interests, IProfileSettingsService profileSettingsService, IUserProfileProvider userProfileProvider, [Greedy] UserProfileService userProfileService) { var profile = userProfileService.GetEmptyProfile(); profile.Should().NotBeNull(); profile.FirstName.Should().BeNull(); profile.LastName.Should().BeNull(); profile.Interest.Should().BeNull(); profile.PhoneNumber.Should().BeNull(); profile.InterestTypes.Should().BeEquivalentTo(interests); }
public void GetUserDefaultProfileIdShouldReturnNull(IProfileSettingsService profileSettingsService, IUserProfileProvider userProfileProvider, [Greedy] UserProfileService userProfileService) { userProfileService.GetUserDefaultProfileId().Should().BeNull(); }
public DcsWorldService(IContainer container) { _container = container; _settingsService = container.Resolve <ISettingsService>(); _profileSettingsService = container.Resolve <IProfileSettingsService>(); }
public void ValidateProfileShouldAddModelError(ModelStateDictionary modelState, [Frozen] IEnumerable <string> interests, IProfileSettingsService profileSettingsService, IUserProfileProvider userProfileProvider, [Greedy] UserProfileService userProfileService) { var editProfile = new EditProfile() { Interest = "invalid interest" }; var result = userProfileService.ValidateProfile(editProfile, modelState); result.Should().BeFalse(); modelState.Keys.Should().Contain("Interest"); }
public CreateProfileWizardStepViewModel(IContainer container) : base(container) { _profileSettingsService = container.Resolve <IProfileSettingsService>(); }
public void ValidateProfileShouldAddModelError(ModelStateDictionary modelState, [Frozen] IEnumerable<string> interests, IProfileSettingsService profileSettingsService, IUserProfileProvider userProfileProvider, [Greedy] UserProfileService userProfileService) { var editProfile = new EditProfile() { Interest = "invalid interest" }; var result = userProfileService.ValidateProfile(editProfile, modelState); result.Should().BeFalse(); modelState.Keys.Should().Contain("Interest"); }
public UserProfileService(IProfileSettingsService profileSettingsService, IUserProfileProvider userProfileProvider) { this.profileSettingsService = profileSettingsService; this.userProfileProvider = userProfileProvider; }
public void ValidateProfileShouldreturnValid(ModelStateDictionary modelState, [Frozen] IEnumerable<string> interests, IProfileSettingsService profileSettingsService, IUserProfileProvider userProfileProvider, [Greedy] UserProfileService userProfileService) { var editProfile = new EditProfile() { Interest = interests.First() }; var result = userProfileService.ValidateProfile(editProfile, modelState); result.Should().BeTrue(); }
public void GetInterestsShouldReturnInterests([Frozen] IEnumerable<string> interests, IProfileSettingsService profileSettingsService, IUserProfileProvider userProfileProvider, [Greedy] UserProfileService userProfileService) { userProfileService.GetInterests().Should().BeEquivalentTo(interests); }
public UserProfileService(IProfileSettingsService profileSettingsService) { this.profileSettingsService = profileSettingsService; }
public void ValidateProfileShouldreturnValid(ModelStateDictionary modelState, [Frozen] IEnumerable <string> interests, IProfileSettingsService profileSettingsService, IUserProfileProvider userProfileProvider, [Greedy] UserProfileService userProfileService) { var editProfile = new EditProfile() { Interest = interests.First() }; var result = userProfileService.ValidateProfile(editProfile, modelState); result.Should().BeTrue(); }
public SelectGameViewportScreensStepViewModel(IContainer container) : base(container) { _profileSettingsService = container.Resolve <IProfileSettingsService>(); }
public void GetUserDefaultProfileIdShouldReturnId([Frozen] Item item, IProfileSettingsService profileSettingsService, IUserProfileProvider userProfileProvider, [Greedy] UserProfileService userProfileService) { userProfileService.GetUserDefaultProfileId().Should().Be(item.ID.ToString()); }