public void ReturnsFalse_GivenEmptyOrNullString() { var creator = new MochaDefinitionCreator(); Assert.False(creator.ClassUnderTest.ReferenceIsDependency(string.Empty, new ChutzpahTestSettingsFile().InheritFromDefault())); Assert.False(creator.ClassUnderTest.ReferenceIsDependency(null, new ChutzpahTestSettingsFile().InheritFromDefault())); }
public void ReturnsTrue_GivenMochaFile() { var creator = new MochaDefinitionCreator(); Assert.True(creator.ClassUnderTest.ReferenceIsDependency("mocha.js", new ChutzpahTestSettingsFile().InheritFromDefault())); Assert.True(creator.ClassUnderTest.ReferenceIsDependency("mocha.css", new ChutzpahTestSettingsFile().InheritFromDefault())); }
public void CallsDependency_GivenOneProcessor() { var creator = new MochaDefinitionCreator(); var processor = creator.Mock <IMochaReferencedFileProcessor>(); creator.ClassUnderTest.Process(new ReferencedFile(), "", new ChutzpahTestSettingsFile().InheritFromDefault()); processor.Verify(x => x.Process(It.IsAny <IFrameworkDefinition>(), It.IsAny <ReferencedFile>(), It.IsAny <string>(), It.IsAny <ChutzpahTestSettingsFile>())); }
public void CallsAllDependencies_GivenMultipleProcessors() { var creator = new MochaDefinitionCreator(); var processor1 = new Mock <IMochaReferencedFileProcessor>(); var processor2 = new Mock <IMochaReferencedFileProcessor>(); creator.InjectArray <IMochaReferencedFileProcessor>(new[] { processor1.Object, processor2.Object }); creator.ClassUnderTest.Process(new ReferencedFile(), "", new ChutzpahTestSettingsFile().InheritFromDefault()); processor1.Verify(x => x.Process(It.IsAny <IFrameworkDefinition>(), It.IsAny <ReferencedFile>(), It.IsAny <string>(), It.IsAny <ChutzpahTestSettingsFile>())); processor2.Verify(x => x.Process(It.IsAny <IFrameworkDefinition>(), It.IsAny <ReferencedFile>(), It.IsAny <string>(), It.IsAny <ChutzpahTestSettingsFile>())); }
public void ReturnsFalse_GivenQUnitFile() { var creator = new MochaDefinitionCreator(); Assert.False(creator.ClassUnderTest.ReferenceIsDependency("qunit.js", new ChutzpahTestSettingsFile().InheritFromDefault())); }
public void ReturnsFalse_WithForeignSuiteAndBestGuessDetection(string suite) { var creator = new MochaDefinitionCreator(); Assert.False(creator.ClassUnderTest.FileUsesFramework(suite, true, PathType.JavaScript)); }
public void ReturnsFalse_WithMochaSuiteAndBestGuessDetection() { var creator = new MochaDefinitionCreator(); Assert.False(creator.ClassUnderTest.FileUsesFramework(Resources.MochaSuite, true, PathType.JavaScript)); }
public void ReturnsTrue_WithCoffeeScriptMochaSuiteAndDefinitiveDetection() { var creator = new MochaDefinitionCreator(); Assert.True(creator.ClassUnderTest.FileUsesFramework(Resources.MochaSuiteCoffee, false, PathType.CoffeeScript)); }