protected override void DoHandle(AddTestCommand request)
        {
            var test = _converter.Convert(request.Test);

            test.CreationDate         = DateTime.Now;
            test.LastModificationDate = DateTime.Now;

            DbContext.Tests.Add(test);
            DbContext.SaveChanges();
        }
Ejemplo n.º 2
0
    //-------------------------------------------------------------------------
    public virtual async Task ConvertAsync(Stream input, TextWriter output)
    {
        XElement testXml = await XElement.LoadAsync(input, LoadOptions.None, CancellationToken.None);

        ITestResultXmlParser <TIn> parser = this.ParserFactory(testXml);

        parser.Parse();
        TIn sourceTest = parser.Result;

        ITestConverter <TIn, TOut> testConverter = this.ConverterFactory(sourceTest);

        testConverter.Convert();
        TOut targetTest = testConverter.Result;

        ITestResultXmlBuilder <TOut> builder = this.BuilderFactory(targetTest);

        builder.Build();

        await builder.Result.SaveAsync(output, SaveOptions.None, CancellationToken.None);
    }