public Library(IBookDao dao) { this.catalog = new CatalogBasicImpl(dao); this.processState = new LibraryState(dao); this.users = new UsersBasicImpl(); this.events = new EventsBasicImpl(); }
private void FillRentals(LibraryState state) { state.BookRentals.Add(new Rental(state.LibraryBooks[1], state.LibraryUsers[4])); state.BookRentals.Add(new Rental(state.LibraryBooks[3], state.LibraryUsers[3])); state.BookRentals.Add(new Rental(state.LibraryBooks[5], state.LibraryUsers[4])); state.BookRentals.Add(new Rental(state.LibraryBooks[0], state.LibraryUsers[1])); state.BookRentals.Add(new Rental(state.LibraryBooks[4], state.LibraryUsers[0])); }
public LibraryUOW(LibraryState libData, IBookDao bDao, IUsersDao uDao, IRentalDao rDao) { libraryData = libData; booksDao = bDao; usersDao = uDao; rentalsDao = rDao; }
private void FillUsers(LibraryState state) { state.LibraryUsers.Add(new User("Jake", "Nadd")); state.LibraryUsers.Add(new User("Jack", "Sparrow")); state.LibraryUsers.Add(new User("David", "Hunter")); state.LibraryUsers.Add(new User("Freddie", "Mercury")); state.LibraryUsers.Add(new User("Khem", "Val")); }
public LibraryDataService() { LibraryState libraryState = new LibraryState(); BookDaoBasicImpl bookDao = new BookDaoBasicImpl(libraryState); UserDaoBasicImpl userDao = new UserDaoBasicImpl(libraryState); RentalDaoBasicImpl rentalDao = new RentalDaoBasicImpl(libraryState); libUOW = new LibraryUOW(libraryState, bookDao, userDao, rentalDao); FillLibraryDataWithConstants(); }
public ActionDrawnForLibrary(Card action, LibraryState state, ITurnScope scope) : base(scope) { Description = "Take " + action.Name + " into hand, or set it aside?"; _action = action; GetAvailableResponses = () => new List <IEventResponse> { new SetAsideActionForLibrary(scope, state, action), new TakeActionCardIntoHandForLibrary(scope, state, action) }; }
private void FillBooks(LibraryState state) { state.LibraryBooks.Add(new Book("The Chemistry of Death", "Simon Beckett", "Crime")); state.LibraryBooks.Add(new Book("The Chemistry of Death", "Simon Beckett", "Crime")); state.LibraryBooks.Add(new Book("Whistleblower", "Tess Gerritsen", "Crime")); state.LibraryBooks.Add(new Book("Whistleblower", "Tess Gerritsen", "Crime")); state.LibraryBooks.Add(new Book("Whistleblower", "Tess Gerritsen", "Crime")); state.LibraryBooks.Add(new Book("Roses are Red", "James Patterson", "Thriller")); state.LibraryBooks.Add(new Book("Brief Answers to the Big Questions", "Stephen Hawking", "Science")); }
public void ShouldReturnLibraryStateFromQueryHandler() { LibraryState libraryStateFromHub = null; var expectedLibraryState = new LibraryState(); _getLibraryStateQueryHandlerMock.Setup(x => x.Handle(It.IsAny <GetLibraryStateQuery>())).Returns(expectedLibraryState); dynamic caller = new ExpandoObject(); caller.updateLibraryState = new Action <LibraryState>((libraryState) => { libraryStateFromHub = libraryState; }); _mockClients.Setup(m => m.Caller).Returns((ExpandoObject)caller); _hub.GetLibraryState("test"); Assert.Equal(expectedLibraryState, libraryStateFromHub); }
public override void PlayAsAction(ITurnScope turnScope) { while (turnScope.Player.Hand.Count() < 7) { var state = new LibraryState(); turnScope.DrawCardIntoCardset(state.DrawnCards); var card = state.DrawnCards.First(); if (card.IsAction) { turnScope.Publish(new ActionDrawnForLibrary(card, state, turnScope)); } else { state.DrawnCards.Add(card, turnScope); } turnScope.PutCardsIntoHand(state.DrawnCards); turnScope.Discard(state.SetAsideCards); } }
public void TearDown() { this.processState = null; this.dao = null; }
public void TearDown() { this.rentalDao = null; this.libState = null; }
public void SetUp() { this.libState = new LibraryState(); this.rentalDao = new RentalDaoBasicImpl(libState); }
public TakeActionCardIntoHandForLibrary(ITurnScope turnScope, LibraryState state, Card item) : base(turnScope, item) { Description = "Take " + item.Name + " into hand"; _state = state; }
public SetAsideActionForLibrary(ITurnScope turnScope, LibraryState state, Card action) : base(turnScope, action) { Description = "Set " + action.Name + " aside"; _state = state; }
public void TearDown() { this.userDao = null; this.libState = null; }
public void SetUp() { this.dao = new BookDaoBasicImpl(); this.processState = new LibraryState(dao); }
public void SetUp() { this.libState = new LibraryState(); this.userDao = new UserDaoBasicImpl(libState); }
public void TearDown() { bookDao = null; libState = null; }
public void SetUp() { libState = new LibraryState(); bookDao = new BookDaoBasicImpl(libState); }
public static void SetPlantLibraryState(int speciesId, LibraryState state) { PlayerPrefs.SetString("Species_" + speciesId, state.ToString()); PlayerPrefs.Save(); }
public BookDaoBasicImpl(LibraryState libData) { libraryData = libData; }
public UserDaoBasicImpl(LibraryState libData) { libraryData = libData; }
public void Fill(LibraryState state) { FillBooks(state); FillUsers(state); FillRentals(state); }
public RentalDaoBasicImpl(LibraryState libData) { libraryData = libData; }