public void ReplacesFluentTokensCorrectly() { var character = new Character ( new User(0), new Server(0), "Amby", string.Empty, string.Empty, string.Empty, string.Empty, pronounProviderFamily: "Feminine" ); var hairColour = new Colour(Shade.White, ShadeModifier.Fluorescent); var hairTransformation = new Transformation ( new Species("dummy", "dummy", "dummy"), "dummy", hairColour, "dummy", "dummy", SampleFluentText ) { Part = Bodypart.Hair, }; var hairComponent = AppearanceComponent.CreateFrom(hairTransformation); var appearance = new Appearance(character); appearance.Components.Add(hairComponent); var pronounService = new PronounService(); pronounService.WithPronounProvider(new FemininePronounProvider()); var characterService = new CharacterService(null !, null !, null !, pronounService); var serviceProvider = new ServiceCollection() .AddSingleton(pronounService) .AddSingleton(characterService) .BuildServiceProvider(); var descriptionBuilder = new TransformationDescriptionBuilder(serviceProvider, new TransformationText()); var result = descriptionBuilder.ReplaceTokensWithContent(SampleFluentText, appearance, hairComponent); Assert.Equal(ExpectedText, result); }
/// <summary> /// Initializes a new instance of the <see cref="CharacterService"/> class. /// </summary> /// <param name="entityService">The application's owned entity service.</param> /// <param name="content">The content service.</param> /// <param name="database">The core database.</param> /// <param name="pronouns">The pronoun service.</param> public CharacterService ( OwnedEntityService entityService, ContentService content, CharactersDatabaseContext database, PronounService pronouns ) { _ownedEntities = entityService; _content = content; _database = database; _pronouns = pronouns; }
/// <summary> /// Initializes a new instance of the <see cref="CharacterCommands"/> class. /// </summary> /// <param name="contentService">The content service.</param> /// <param name="feedbackService">The feedback service.</param> /// <param name="characterService">The character service.</param> /// <param name="interactivity">The interactivity service.</param> /// <param name="pronouns">The pronoun service.</param> public CharacterCommands ( ContentService contentService, UserFeedbackService feedbackService, CharacterDiscordService characterService, InteractivityService interactivity, PronounService pronouns ) { _content = contentService; _feedback = feedbackService; _characters = characterService; _interactivity = interactivity; _pronouns = pronouns; }
/// <summary> /// Initializes a new instance of the <see cref="CharacterCommands"/> class. /// </summary> /// <param name="contentService">The content service.</param> /// <param name="feedbackService">The feedback service.</param> /// <param name="characterService">The character service.</param> /// <param name="pronouns">The pronoun service.</param> /// <param name="context">The command context.</param> /// <param name="guildAPI">The guild API.</param> /// <param name="channelAPI">The channel API.</param> public CharacterCommands ( ContentService contentService, FeedbackService feedbackService, CharacterDiscordService characterService, PronounService pronouns, ICommandContext context, IDiscordRestGuildAPI guildAPI, IDiscordRestChannelAPI channelAPI ) { _content = contentService; _feedback = feedbackService; _characters = characterService; _pronouns = pronouns; _context = context; _guildAPI = guildAPI; _channelAPI = channelAPI; }
/// <summary> /// Initializes a new instance of the <see cref="CharacterService"/> class. /// </summary> /// <param name="commands">The application's command service.</param> /// <param name="entityService">The application's owned entity service.</param> /// <param name="content">The content service.</param> /// <param name="users">The user service.</param> /// <param name="servers">The server service.</param> /// <param name="database">The core database.</param> /// <param name="pronouns">The pronoun service.</param> public CharacterService ( [NotNull] CommandService commands, [NotNull] OwnedEntityService entityService, [NotNull] ContentService content, [NotNull] UserService users, [NotNull] ServerService servers, [NotNull] CharactersDatabaseContext database, [NotNull] PronounService pronouns ) { _commands = commands; _ownedEntities = entityService; _content = content; _users = users; _servers = servers; _database = database; _pronouns = pronouns; }
/// <summary> /// Initializes a new instance of the <see cref="FluentPronounToken"/> class. /// </summary> /// <param name="pronouns">The pronoun service.</param> public FluentPronounToken(PronounService pronouns) { _pronouns = pronouns; }
/// <inheritdoc /> protected override void ConfigureServices(IServiceProvider serviceProvider) { this.Pronouns = serviceProvider.GetRequiredService <PronounService>(); }
/// <summary> /// Initializes a new instance of the <see cref="FluentPronounToken"/> class. /// </summary> /// <param name="pronouns">The pronoun service.</param> public FluentPronounToken([NotNull] PronounService pronouns) { _pronouns = pronouns; }
/// <summary> /// Initializes a new instance of the <see cref="PronounToken"/> class. /// </summary> /// <param name="pronouns">The character service.</param> public PronounToken(PronounService pronouns) { _pronouns = pronouns; }