internal static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.ThreadException += GlobalExceptionHandler; Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); AppDomain.CurrentDomain.UnhandledException += GlobalExceptionHandler; IXDocumentParser xDocParser = new XDocumentParser(); IWordBank <Question> wordBank = new XmlWordBank(xDocParser); wordBank.InitialiseWordBank(Repository.Properties.Resources.wordsDefault); var speechSynthesizer = new SpeechSynthesizer { Volume = 100, Rate = -3, }; speechSynthesizer.SelectVoiceByHints(VoiceGender.Male); Application.Run(new Main(wordBank, speechSynthesizer)); }
public void InitialiseWordBank_CallParseXDocument_ExactlyOnce() { _fakeXDocParser.Setup(x => x.ParseXDocument(It.IsAny <string>())) .Returns(_xDocument); _sut.InitialiseWordBank(It.IsAny <string>()); _fakeXDocParser.Verify(x => x.ParseXDocument(It.IsAny <string>()), Times.Once()); }
public void InitialiseWordBank_InitPropertyWordMap_With10Items() { _sut.InitialiseWordBank(_xmlString); Dictionary <string, string> wordMap = _sut.WordMap; Assert.AreEqual(10, wordMap.Count); }