public void Should_Return_Empty_String_If_Yaml_File_Does_Not_Exit() { // Given var sourceCode = Substitute.For<ISourceCode>(); sourceCode.GetAll.Returns(new[] { @"C:\Fake\Class.cs", @"C:\Fake\Interface\IClass.cs", @"C:\Fake\.git" }); var yaml = new Codecov.Yaml.Yaml(sourceCode); // When var fileName = yaml.FileName; // Then fileName.Should().BeEmpty(); }
public void Should_Find_Yaml_File_If_Exits() { // Given var sourceCode = Substitute.For<ISourceCode>(); sourceCode.GetAll.Returns(new[] { @"C:\Fake\Class.cs", @"C:\Fake\Interface\IClass.cs", @"C:\Fake\.git", @"C:\Fake\codecov.yaml" }); var yaml = new Codecov.Yaml.Yaml(sourceCode); // When var fileName = yaml.FileName; // Then fileName.Should().Be("codecov.yaml"); }
public void Should_Return_Empty_String_If_Yaml_File_Does_Not_Exit() { // Given var sourceCode = Substitute.For <ISourceCode>(); sourceCode.GetAll.Returns(new[] { Path.Combine(_systemDrive, "Fake", "Class.cs"), Path.Combine(_systemDrive, "Fake", "Interface", "IClass.cs"), Path.Combine(_systemDrive, "Fake", ".git") }); var yaml = new Codecov.Yaml.Yaml(sourceCode); // When var fileName = yaml.FileName; // Then fileName.Should().BeEmpty(); }
public void Should_Find_Yaml_File_If_Exists(string configFileName) { // Given var sourceCode = Substitute.For <ISourceCode>(); sourceCode.GetAll.Returns(new[] { Path.Combine(_systemDrive, "Fake", "Class.cs"), Path.Combine(_systemDrive, "Fake", "Interface", "IClass.cs"), Path.Combine(_systemDrive, "Fake", ".git"), Path.Combine(_systemDrive, "Fake", configFileName) }); var yaml = new Codecov.Yaml.Yaml(sourceCode); // When var fileName = yaml.FileName; // Then fileName.Should().Be(configFileName); }