Tp.MashupManager.MashupLibrary.Repository.Config.LibraryRepositoryConfigStorage.GetConfigs C# (CSharp) Method

GetConfigs() public method

public GetConfigs ( ) : IEnumerable
return IEnumerable
		public IEnumerable<ILibraryRepositoryConfig> GetConfigs()
		{	
			return _singleProfile.Profile.NothingIfNull()
				.Bind(x => x.GetProfile<MashupManagerProfile>().LibraryRepositoryConfigs.NothingIfNull()
					.Where(y => y.Any())
					.Select(y => y.Cast<ILibraryRepositoryConfig>()))
				.GetOrElse(()=>DefaultConfigs);
		}

Usage Example

		public void ShouldReturnDefaultConfigsIfProfileIsNotCreatedYet()
		{
			var singleProfileStub = MockRepository.GenerateStub<ISingleProfile>();
			singleProfileStub.Stub(x => x.Profile).Return(null);
			var configStorage = new LibraryRepositoryConfigStorage(singleProfileStub){DefaultConfigs = _expectedDefaultConfigs};
			var configs = configStorage.GetConfigs();

			configs.Should(Be.EqualTo(_expectedDefaultConfigs), "library repository configs is not equal to expected");
		}
All Usage Examples Of Tp.MashupManager.MashupLibrary.Repository.Config.LibraryRepositoryConfigStorage::GetConfigs
LibraryRepositoryConfigStorage