public void InvalidFrameworkStructureDoesNotShowUp() { DeleteEnvironmentVariable(); Directory.CreateDirectory(DefaultFramework.ToString()); var invalidFrameworks = new FrameworkFinder(); Assert.AreEqual(0, invalidFrameworks.All.Length); Directory.Delete(DefaultFramework.ToString()); DeleteFrameworkFolders(); }
private void GetVisualTestsFromInstallPath(DeltaEngineFramework framework) { string frameworkPath = Path.Combine(installPath, framework.ToString()); foreach (var file in Directory.GetFiles(frameworkPath)) { if (file.Contains(".Editor.") || (!file.EndsWith(".Tests.exe") && !file.EndsWith(".Tests.dll"))) { continue; } try { TryGetVisualTestsFromInstallPath(frameworkPath, file); } catch (ReflectionTypeLoadException ex) { ShowLoaderExceptionWarning(file, ex); } catch (FileLoadException ex) { Logger.Warning("Failed to load dependency for " + file + ": " + ex.Message); } } }
public static string ToInternalShortName(this DeltaEngineFramework framework) { if (framework == DeltaEngineFramework.Default) { throw new ArgumentException(framework.ToString()); } return(FrameworkShortNames[framework]); }
public static string[] GetAllTemplateNames(DeltaEngineFramework framework) { if (!PathExtensions.IsDeltaEnginePathEnvironmentVariableAvailable()) { Logger.Warning("No Visual Studio Templates found, please use the Installer to set them up"); return new string[0]; } var templatePath = Path.Combine(PathExtensions.GetDeltaEngineInstalledDirectory(), framework.ToString(), "VisualStudioTemplates", "Delta Engine"); var templateNames = new List<string>(); foreach (var file in Directory.GetFiles(templatePath)) templateNames.Add(Path.GetFileNameWithoutExtension(file)); templateNames.Remove("EmptyLibrary"); return templateNames.ToArray(); }
public static string[] GetAllTemplateNames(DeltaEngineFramework framework) { if (!PathExtensions.IsDeltaEnginePathEnvironmentVariableAvailable()) { //ncrunch: no coverage start Logger.Warning("No Visual Studio Templates found, please use the Installer to set them up"); return(new string[0]); } //ncrunch: no coverage end var templatePath = Path.Combine(PathExtensions.GetDeltaEngineInstalledDirectory(), framework.ToString(), "VisualStudioTemplates", "Delta Engine"); var templateNames = new List <string>(); foreach (var file in Directory.GetFiles(templatePath)) { templateNames.Add(Path.GetFileNameWithoutExtension(file)); } templateNames.Remove("EmptyLibrary"); return(templateNames.ToArray()); }
private void GetExecutablesFromInstallPath(DeltaEngineFramework framework, SampleCategory category) { if (category != SampleCategory.Game && category != SampleCategory.Tutorial) { return; } string frameworkPath = Path.Combine(installPath, framework.ToString()); string[] directories = Directory.GetDirectories(Path.Combine(frameworkPath, category == SampleCategory.Game ? "Samples" : "Tutorials")); foreach (string projectDirectory in directories) { if (!projectDirectory.Contains("EmptyLibrary")) { AddSample(category, projectDirectory, frameworkPath); } } }
private void GetVisualTestsFromInstallPath(DeltaEngineFramework framework) { string frameworkPath = Path.Combine(installPath, framework.ToString()); foreach (var file in fileSystem.Directory.GetFiles(frameworkPath)) { if (file.Contains(".Editor.") || (!file.EndsWith(".Tests.exe") && !file.EndsWith(".Tests.dll"))) continue; try { Assembly assembly = Assembly.LoadFrom(file); foreach (var type in assembly.GetTypes()) { if (type.IsDefined(typeof(CompilerGeneratedAttribute), false) || !IsVisualTestClass(type)) continue; foreach (var method in type.GetMethods().Where(IsVisualTestMethod)) { string solutionFilePath = ""; string projectFilePath = ""; if (!type.Namespace.Contains("DeltaEngine")) { solutionFilePath = Path.Combine(frameworkPath, "DeltaEngine.Samples.sln"); projectFilePath = GetSampleTestsProjectFilePaths(frameworkPath, assembly.GetName().Name); } Samples.Add(new Sample(assembly.GetName().Name + ": " + method.Name, SampleCategory.Test, solutionFilePath, projectFilePath, file) { EntryClass = type.Name, EntryMethod = method.Name }); } } } catch (ReflectionTypeLoadException ex) { Logger.Warning("Failed to load " + file + ". LoaderExceptions: " + ex.LoaderExceptions.ToText()); } catch (FileLoadException ex) { Logger.Warning("Failed to load dependency for " + file + ": " + ex.Message); } } }
private void GetExecutablesFromInstallPath(DeltaEngineFramework framework, SampleCategory category) { if (category != SampleCategory.Game && category != SampleCategory.Tutorial) return; string frameworkPath = Path.Combine(installPath, framework.ToString()); string[] directories = fileSystem.Directory.GetDirectories(Path.Combine(frameworkPath, category == SampleCategory.Game ? "Samples" : "Tutorials")); foreach (string projectDirectory in directories) if (!projectDirectory.Contains("EmptyLibrary")) AddSample(category, projectDirectory, frameworkPath); }
private void GetVisualTestsFromInstallPath(DeltaEngineFramework framework) { string frameworkPath = Path.Combine(installPath, framework.ToString()); foreach (var file in Directory.GetFiles(frameworkPath)) { if (file.Contains(".Editor.") || (!file.EndsWith(".Tests.exe") && !file.EndsWith(".Tests.dll"))) continue; try { TryGetVisualTestsFromInstallPath(frameworkPath, file); } catch (ReflectionTypeLoadException ex) { ShowLoaderExceptionWarning(file, ex); } catch (FileLoadException ex) { Logger.Warning("Failed to load dependency for " + file + ": " + ex.Message); } } }