private void InitializeFilterSettings(FilterSettings filterSettings, string filePath) { // ensure that code samples of test user are present var testCodes = filterSettings.CodeDefinitions.Where(code => code.Owner == "*****@*****.**"); if (!testCodes.Any(testCode => testCode.Name == "Simple filter (C#)")) { using var streamReader1 = new StreamReader(ResourceLoader.GetResourceStream("Nexus.Resources.TestUserFilterCodeTemplateSimple.cs")); filterSettings.CodeDefinitions.Add(new CodeDefinition() { Code = streamReader1.ReadToEnd(), CodeLanguage = CodeLanguage.CSharp, CodeType = CodeType.Filter, CreationDate = DateTime.UtcNow, IsEnabled = true, Name = "Simple filter (C#)", Owner = "*****@*****.**", RequestedProjectIds = new List <string>() { "/IN_MEMORY/TEST/ACCESSIBLE" }, SampleRate = "1 s" }); filterSettings.Save(filePath); } if (!testCodes.Any(testCode => testCode.Name == "Simple shared (C#)")) { using var streamReader2 = new StreamReader(ResourceLoader.GetResourceStream("Nexus.Resources.TestUserSharedCodeTemplateSimple.cs")); filterSettings.CodeDefinitions.Add(new CodeDefinition() { Code = streamReader2.ReadToEnd(), CodeLanguage = CodeLanguage.CSharp, CodeType = CodeType.Shared, CreationDate = DateTime.UtcNow, IsEnabled = true, Name = "Simple shared (C#)", Owner = "*****@*****.**", RequestedProjectIds = new List <string>(), SampleRate = string.Empty }); filterSettings.Save(filePath); } }