Exemplo n.º 1
0
 public static ContainerBuilder UseForPeghTest(this ContainerBuilder builder, IPeghEnvironment peghEnvironment, ICsArgumentPrompter csArgumentPrompter)
 {
     RegisterDefaultTypes(builder);
     builder.RegisterType <SecretRepository>().As <ISecretRepository>();
     builder.RegisterInstance(peghEnvironment).As <IPeghEnvironment>();
     builder.RegisterType <Disguiser>().As <IDisguiser>();
     builder.RegisterInstance(csArgumentPrompter).As <ICsArgumentPrompter>();
     return(builder);
 }
Exemplo n.º 2
0
    public SecretRepository(ICsArgumentPrompter csArgumentPrompter, ICsLambdaCompiler csLambdaCompiler, IDisguiser disguiser, IPeghEnvironment peghEnvironment, IXmlDeserializer xmlDeserializer, IXmlSerializer xmlSerializer, IXmlSchemer xmlSchemer)
    {
        CsArgumentPrompter = csArgumentPrompter;
        CsLambdaCompiler   = csLambdaCompiler;
        Disguiser          = disguiser;
        PeghEnvironment    = peghEnvironment;
        XmlDeserializer    = xmlDeserializer;
        XmlSchemer         = xmlSchemer;
        XmlSerializer      = xmlSerializer;
        Values             = new Dictionary <string, object>();
        var folder = PeghEnvironment.RootWorkFolder + @"\SecretSamples\";

        if (!Directory.Exists(folder))
        {
            Directory.CreateDirectory(folder);
        }
        folder = PeghEnvironment.RootWorkFolder + @"\SecretRepository\";
        if (!Directory.Exists(folder))
        {
            Directory.CreateDirectory(folder);
        }
    }