public Book CreateNewBook(Factory f) { var book = new Book(); f.Build(book) .FillUninitialisedValueObjects() .Fill(b => b.Publisher) .Set(b => b.ISBN = GenerateIsbn()); return book; }
public void Setup() { mFactory = new Factory(new DefaultModuleConfiguration(), new ITModuleConfiguration()); mObserver = (RecordingObserver)mFactory.Build<IMessageObserver>(); mApp = mFactory.Build<IApp>(); mFile = new DotNetFile(); mRefreshToken = new RefreshTokenStore(mFile, "refreshToken.txt"); mCredentials = new CredentialStore(mFile, "credentials.txt"); var provider = new TestConfigurationProvider(); provider.SetupCredentialsFile(); provider.SetupRefreshTokenFile(); provider.SetupDummyFile(); mFileManager = new GDriveFileManager(mCredentials.Get(), mRefreshToken.Get()); new Retry(30, 125) .WithWork(x => { mFileManager.CleanGDriveAcct(); Assert.That(mFileManager.ListAllFilesOnRootById().ToArray(), Is.Empty); }) .Start(); mFolderManager = new FolderManager(mCredentials.Get(), mRefreshToken.Get()); }
public Book CreateBook(Factory factory) { return factory.Build(new Book()) .FillUninitialisedValueObjects() .Fill(b => b.Publisher) .Set(b => b.ISBN = "12345678") .Entity; }