public CharactersController( ICharactersService charactersService, IDatabaseContext databaseContext) { _charactersService = charactersService; _databaseContext = databaseContext; }
public CharacterServiceTests() { _mockCharacterRepo = new Mock <ICharacterRepository>(); _mockEpisodeService = new Mock <IEpisodesService>(); _sut = new CharactersService( _mockCharacterRepo.Object, _mockEpisodeService.Object ); }
public ComicsViewModel(IArtistsService artistsService, IBooksService booksService, ICharactersService charactersService, ICodesService codesService, IPublishersService publishersService, ISeriesService seriesService, IStoriesService storiesService, IExportBooksService exportBooksService, IMapper mapper, NavigationService navigationService, IConfiguration configuration) : base(mapper) { _navigationService = navigationService; _configuration = configuration; ArtistView = new ArtistViewModel(artistsService, mapper); BookView = new BookViewModel(booksService, mapper); CharacterView = new CharacterViewModel(charactersService, mapper); CodeView = new CodeViewModel(codesService, mapper); PublisherView = new PublisherViewModel(publishersService, mapper); SeriesView = new SeriesViewModel(seriesService, mapper); StoryView = new StoryViewModel(storiesService, mapper); ReportView = new ReportViewModel(exportBooksService, mapper); Languages = LanguageType.FillLanguages(); Actives = FillEnum <Active>(); FirstPrints = FillEnum <FirstPrint>(); BookTypes = FillEnum <BookType>(); StoryTypes = FillEnum <StoryType>(); ShowArtistFromStoryWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowArtistFromStoryWindow)); ShowBookFromPublisherWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowBookFromPublisherWindow)); ShowBookFromSeriesWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowBookFromSeriesWindow)); ShowBookFromStoryWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowBookFromStoryWindow)); ShowCharacterFromStoryWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowCharacterFromStoryWindow)); ShowCodeFromSeriesWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowCodeFromSeriesWindow)); ShowCodeFromStoryWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowCodeFromStoryWindow)); ShowPublisherFromBookWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowPublisherFromBookWindow)); ShowSeriesFromBookWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowSeriesFromBookWindow)); ShowSeriesFromCodeWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowSeriesFromCodeWindow)); ShowStoryFromArtistWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowStoryFromArtistWindow)); ShowStoryFromBookWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowStoryFromBookWindow)); ShowStoryFromCharacterWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowStoryFromCharacterWindow)); ShowStoryFromCodeWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowStoryFromCodeWindow)); ShowArtistWindowCommand = new RelayCommand(new Action(ShowArtistWindow)); ShowBookWindowCommand = new RelayCommand(new Action(ShowBookWindow)); ShowCharacterWindowCommand = new RelayCommand(new Action(ShowCharacterWindow)); ShowCodeWindowCommand = new RelayCommand(new Action(ShowCodeWindow)); ShowPublisherWindowCommand = new RelayCommand(new Action(ShowPublisherWindow)); ShowSeriesWindowCommand = new RelayCommand(new Action(ShowSeriesWindow)); ShowStoryWindowCommand = new RelayCommand(new Action(ShowStoriesWindow)); ShowReportWindowCommand = new RelayCommand(new Action(ShowReportWindow)); }
public DnDBeyondQuery(ICharactersService charactersService) { Name = "Query"; // Get all characters Field <ListGraphType <CharacterType> >( "characters", resolve: context => charactersService.GetCharacters()); // Get character by id Field <CharacterType>( "character", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <IdGraphType> > { Name = "id", Description = "id of the character" }), resolve: context => charactersService.GetCharacter(context.GetArgument <long>("id"))); }
public async Task Setup() { _connection = InMemoryDbConnectionFactory.CreateInMemoryDbConnection(); IConfiguration configuration = Substitute.For <IConfiguration>(); configuration["PageSize"].Returns("5"); configuration["DatabasePath"].Returns(DataAccessConstants.InMemoryDbPath); var services = new ServiceCollection(); services.AddSingleton <IConfiguration>(configuration); services.Bootstrap(configuration); // overwrites services.AddDbContext <StarWarsDbContext>(options => options.UseSqlite(_connection)); // resolve tested component var provider = services.BuildServiceProvider(); _serviceUnderTests = provider.GetRequiredService <ICharactersService>(); }
public CharacterCommandHandler(ICharactersService charactersService) { _charactersService = charactersService; }
public GetCharacterNamesQueryHandler(ICharactersService charactersService) { _charactersService = charactersService; }
public CharactersController(ICharactersService charactersService, IMessageSession messageSession) { _charactersService = charactersService; _messageSession = messageSession; }
public CharactersController(ICharactersService charactersService) { _charactersService = charactersService; }
public CharactersController(ICharactersService charactersService, ILogger <CharactersController> logger) { _charactersService = charactersService; _logger = logger; }
/// <summary> /// Initializes a new instance of the <see cref="CharactersController"/> class. /// </summary> /// <param name="logger">Logger for the class.</param> /// <param name="charactersService">Service to perform character logic.</param> public CharactersController(ILogger <CharactersController> logger, ICharactersService charactersService) { _logger = logger; _charactersService = charactersService; }
public DnDBeyondMutation(ICharactersService charactersService, IHitPointsService hitPointsService) { Name = "Mutation"; // Create new character Field <CharacterType>( "createCharacter", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <Inputs.CharacterInput> > { Name = "character" }), resolve: context => { var character = context.GetArgument <Character>("character"); return(charactersService.CreateCharacter(character)); }); // Update character's temporary hit points Field <CharacterType>( "updateTemporaryHitPoints", arguments: new QueryArguments( new QueryArgument <IdGraphType> { Name = "id" }, new QueryArgument <IntGraphType> { Name = "temporaryHitPoints" }), resolve: context => { var id = context.GetArgument <long>("id"); var temporaryHitPoints = context.GetArgument <int>("temporaryHitPoints"); return(hitPointsService.UpdateTemporaryHitPoints(id, temporaryHitPoints)); }); // Damage a character Field <CharacterType>( "damageCharacter", arguments: new QueryArguments( new QueryArgument <IdGraphType> { Name = "id" }, new QueryArgument <IntGraphType> { Name = "damage" }, new QueryArgument <StringGraphType> { Name = "damageType" }), resolve: context => { var id = context.GetArgument <long>("id"); var damage = context.GetArgument <int>("damage"); var damageType = context.GetArgument <string>("damageType"); return(hitPointsService.DamageCharacter(id, damage, damageType)); }); // Heal a character Field <CharacterType>( "healCharacter", arguments: new QueryArguments( new QueryArgument <IdGraphType> { Name = "id" }, new QueryArgument <IntGraphType> { Name = "heal" }), resolve: context => { var id = context.GetArgument <long>("id"); var heal = context.GetArgument <int>("heal"); return(hitPointsService.HealCharacter(id, heal)); }); }
public CharactersViewModel(ICharactersService charactersService) { _charactersService = charactersService; Characters = new SmartObservableCollection <CharacterCellViewModel>(); }