Ejemplo n.º 1
0
            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()));
            }
Ejemplo n.º 2
0
            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()));
            }
Ejemplo n.º 3
0
            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>()));
            }
Ejemplo n.º 4
0
            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>()));
            }
Ejemplo n.º 5
0
            public void ReturnsFalse_GivenQUnitFile()
            {
                var creator = new MochaDefinitionCreator();

                Assert.False(creator.ClassUnderTest.ReferenceIsDependency("qunit.js", new ChutzpahTestSettingsFile().InheritFromDefault()));
            }
Ejemplo n.º 6
0
            public void ReturnsFalse_WithForeignSuiteAndBestGuessDetection(string suite)
            {
                var creator = new MochaDefinitionCreator();

                Assert.False(creator.ClassUnderTest.FileUsesFramework(suite, true, PathType.JavaScript));
            }
Ejemplo n.º 7
0
            public void ReturnsFalse_WithMochaSuiteAndBestGuessDetection()
            {
                var creator = new MochaDefinitionCreator();

                Assert.False(creator.ClassUnderTest.FileUsesFramework(Resources.MochaSuite, true, PathType.JavaScript));
            }
Ejemplo n.º 8
0
            public void ReturnsTrue_WithCoffeeScriptMochaSuiteAndDefinitiveDetection()
            {
                var creator = new MochaDefinitionCreator();

                Assert.True(creator.ClassUnderTest.FileUsesFramework(Resources.MochaSuiteCoffee, false, PathType.CoffeeScript));
            }