コード例 #1
0
        public static void ClassInitialize(TestContext testContext)
        {
            var configurationMockSetup = new Mock <IConfiguration>();

            configurationMockSetup.Setup(x => x["DictionaryFileLocation"]).Returns("anywhere");
            _configurationMock = configurationMockSetup.Object;

            TreeNode tNode = new TreeNode(TestWord);

            tNode.AddWord("today");
            tNode.AddWord("termics");
            tNode.AddWord("tomorrow");
            tNode.AddWord("tastings");

            TreeNode gNode = new TreeNode("game");

            gNode.AddWord("go");
            gNode.AddWord("get");

            TreeNode wNode = new TreeNode("we");

            _dictionary = new Dictionary <char, TreeNode>
            {
                { 't', tNode },
                { 'g', gNode },
                { 'w', wNode }
            };

            var providerMockSetup = new Mock <IWordsProvider>();

            providerMockSetup.Setup(x => x.CreateNodesFromDictionaryFile(It.IsAny <string>())).Returns(_dictionary);
            _providerMock = providerMockSetup.Object;
        }
コード例 #2
0
 public CircularCloudLayouter(
     ICurve curve,
     IWordsProvider wordsProvider,
     IWordsFilter wordsFilter)
 {
     this.curve    = curve;
     WordsProvider = wordsProvider;
     WordsFilter   = wordsFilter;
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HelpDeskIdGenerator"/> class.
 /// </summary>
 /// <param name="numberOfWords">The number of words to pick. Defaults to 3.</param>
 /// <param name="separator">The word separator to use. Defaults to "-".</param>
 /// <param name="wordsProvider">The <see cref="IWordsProvider"/> to source the words. Defaults to <see cref="ResourcesWordsProvider"/>.</param>
 public HelpDeskIdGenerator(
     int numberOfWords            = 3,
     string separator             = "-",
     IWordsProvider wordsProvider = null)
 {
     _numberOfWords = numberOfWords;
     _separator     = separator ?? throw new ArgumentNullException(nameof(separator));
     _wordsProvider = wordsProvider ?? new ResourcesWordsProvider();
 }
コード例 #4
0
 private static CloudBuilder PrepareCloudBuilder(
     IWordsProvider wordsProvider,
     IStyleProvider styleProvider,
     ICloudLayouter layouter,
     ICloudSettingsProvider settingsProvider)
 {
     return(CloudBuilder.StartNew(layouter, settingsProvider)
            .WithWordsSize(word => TextRenderer.MeasureText(word, styleProvider.GetStyle(word).Font))
            .WithWords(wordsProvider.GetWords()));
 }
コード例 #5
0
 public CloudRenderer(
     IWordsProvider wordsProvider,
     IStyleProvider styleProvider,
     ICloudLayouter cloudLayouter,
     ICloudSettingsProvider settingsProvider)
 {
     this.styleProvider    = styleProvider;
     this.settingsProvider = settingsProvider;
     cloudBuilder          = PrepareCloudBuilder(wordsProvider, styleProvider, cloudLayouter, settingsProvider);
 }
コード例 #6
0
 public MainMenu(IWordsProvider wordsProvider,
                 UserOutput userOutput,
                 IUserInputParser userInputParser,
                 IGameInterfaceManager gameInterfaceManager,
                 IGameMediator gameMediator)
 {
     _wordsProvider        = wordsProvider;
     _userOutput           = userOutput;
     _userInputParser      = userInputParser;
     _gameInterfaceManager = gameInterfaceManager;
     _gameMediator         = gameMediator;
 }
コード例 #7
0
ファイル: TagCreator.cs プロジェクト: GangBoss/di
 public TagCreator(IWordsProvider wordsProvider,
                   IFrequencyProvider frequencyProvider,
                   ISizableProvider sizableProvider,
                   IDrawableProvider drawableProvider,
                   IDrawer drawer)
 {
     this.wordsProvider     = wordsProvider;
     this.frequencyProvider = frequencyProvider;
     this.sizableProvider   = sizableProvider;
     this.drawableProvider  = drawableProvider;
     this.drawer            = drawer;
 }
コード例 #8
0
 public StyleProvider(IWordsProvider wordsProvider, IStyleSettingsProvider settingsProvider)
 {
     this.wordsProvider    = wordsProvider;
     this.settingsProvider = settingsProvider;
 }
コード例 #9
0
 public CloudTagProvider(CloudTagProperties properties, IWordsProvider provider)
 {
     this.properties = properties;
     this.provider   = provider;
 }
コード例 #10
0
 public HangmanGame(IWordsProvider wordsProvider, IVisualizationProvider visualizationProvider)
 {
     _wordsProvider         = wordsProvider;
     _visualizationProvider = visualizationProvider;
 }
コード例 #11
0
 public CompetencesSearchWordsProvider(CachedItemProvider<IList<string>> cachedWords, IWordsProvider wordsProvider)
 {
     _cachedItemProvider = cachedWords;
     _wordsProvider = wordsProvider;
 }
コード例 #12
0
ファイル: WordTreeManager.cs プロジェクト: luisega/ghost-game
 public WordTreeManager(IWordsProvider wordsProvider, IConfiguration configuration)
 {
     _parentNodes = wordsProvider.CreateNodesFromDictionaryFile(configuration["DictionaryFileLocation"]);
 }