Пример #1
0
        private static void CheckModules(string modules)
        {
            var requiredModules = modules.Split(',');
            var actualModules   = CoreTestConfiguration.GetModules().ToArray();

            if (requiredModules.Any(requiredModule => !actualModules.Contains(requiredModule)))
            {
                var requiredCsv = string.Join(", ", requiredModules);
                var actualCsv   = string.Join(", ", actualModules);
                throw new SkipTestException($"Test skipped because one or more required modules is missing (required: [{requiredCsv}], actual: [{actualCsv}]).");
            }
        }
        private void EnsureModules()
        {
            if (_modules != null)
            {
                var modules = CoreTestConfiguration.GetModules();

                if (!_modules.All(x => modules.Contains(x)))
                {
                    var message = string.Format("Requires modules [{0}], but currently connected to a server with [{1}] modules.",
                                                string.Join(", ", _modules),
                                                string.Join(", ", modules));
                    Assert.Ignore(message);
                }
            }
        }