public void FileExists_ShouldReturnWords() { var config = this.CreateConfig("words_alpha.txt", "Resources"); var provider = new FileWordProvider(config, this.loggerMock.Object); var works = provider.GetWords(); works.Should().NotBeEmpty(); }
public void PathIsNull_ShouldThrowException() { Assert.Throws <ArgumentNullException>(() => { var provider = new FileWordProvider(null, this.loggerMock.Object); }); Assert.Throws <ArgumentNullException>(() => { var provider = new FileWordProvider(new GameConfiguration(), null); }); }
public void FileNotExists_ShouldNotReturnWords() { var config = this.CreateConfig("someFile.txt", "Resources"); var provider = new FileWordProvider(config, this.loggerMock.Object); Assert.Throws <InvalidOperationException>(() => { var works = provider.GetWords(); }); this.loggerMock.Verify(m => m.Error(It.IsAny <FileNotFoundException>(), It.IsAny <string>())); }