/// <summary> /// Creates an instance of the private class for testing the functionality which handles a query for getting a collection of storage types. /// </summary> /// <param name="fixture">Auto fixture.</param> /// <param name="translationInfo">The translation informations which should be used when unit testing.</param> /// <param name="storageTypeCollection">The collection of storage types which should be used when unit testning.</param> /// <param name="storageTypeIdentificationViewCollection">The collection of the view for storage type identification which should be used when unit testing.</param> /// <returns>Instance of the private class for testing the functionality which handles a query for getting a collection of storage types.</returns> private MyStorageTypeCollectionGetQueryHandler CreateSut(Fixture fixture, ITranslationInfo translationInfo = null, IEnumerable <IStorageType> storageTypeCollection = null, IEnumerable <StorageTypeIdentificationView> storageTypeIdentificationViewCollection = null) { if (fixture == null) { throw new ArgumentNullException(nameof(fixture)); } _systemDataRepositoryMock = MockRepository.GenerateMock <ISystemDataRepository>(); _systemDataRepositoryMock.Stub(m => m.Get <ITranslationInfo>(Arg <Guid> .Is.Anything)) .Return(translationInfo ?? DomainObjectMockBuilder.BuildTranslationInfoMock()) .Repeat.Any(); _systemDataRepositoryMock.Stub(m => m.StorageTypeGetAll()) .Return(storageTypeCollection ?? DomainObjectMockBuilder.BuildStorageTypeMockCollection()) .Repeat.Any(); _objectMapperMock = MockRepository.GenerateMock <IFoodWasteObjectMapper>(); _objectMapperMock.Stub(m => m.Map <IEnumerable <IStorageType>, IEnumerable <StorageTypeIdentificationView> >(Arg <IEnumerable <IStorageType> > .Is.Anything, Arg <CultureInfo> .Is.Anything)) .Return(storageTypeIdentificationViewCollection ?? fixture.CreateMany <StorageTypeIdentificationView>(7).ToList()) .Repeat.Any(); return(new MyStorageTypeCollectionGetQueryHandler(_systemDataRepositoryMock, _objectMapperMock)); }