Ejemplo n.º 1
0
        public void TotalTest()
        {
            const string ErrorMessage = "TestErrorMessage";
            const string WarningMessage = "TestErrorMessage";
            const string ExceptionMessage = "TestException";
            var exception = new Exception(ExceptionMessage);

            var instance = new SynchronizationContext();

            instance.AddError(ErrorMessage);
            instance.AddWarning(WarningMessage);
            instance.AddException(exception);

            Assert.AreEqual(ErrorMessage, instance.Errors.First());
            Assert.AreEqual(WarningMessage, instance.Warnings.First());
            Assert.AreEqual(ExceptionMessage, instance.Exceptions.First().Message);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Build mock projects for development and testing purpose.
        /// </summary>
        /// <param name="context">The context with parameters.</param>
        public override void BuildProjects(ILibraryBuilderContext context)
        {
            var v = new SynchronizationContext();
            v.AddWarning("adf");
            var path = TestFolder;

            if (string.IsNullOrWhiteSpace(path))
                return;

            if (!Directory.Exists(path))
                Directory.CreateDirectory(path);

            if ((context.LibraryType & LibraryTypes.System) != 0)
            {
                BuildServerProject(
                    context.SourceCode.Where(c => c.Value.IsSystem).ToDictionary(c => c.Key, c => c.Value),
                    path,
                    Constants.SystemProcessesLibName);
            }

            if ((context.LibraryType & LibraryTypes.Custom) != 0)
            {
                BuildServerProject(
                    context.SourceCode.Where(c => !c.Value.IsSystem).ToDictionary(c => c.Key, c => c.Value),
                    path,
                    Constants.ProcessesLibName,
                    Constants.SystemProcessesLibName + ".Server");
            }
        }