Example #1
0
        private PerfionClientImpl CreateSubject(ArchiveOptions globalArchiveOptions = null)
        {
            _archiveService = Substitute.For <IArchiveService>();
            _kernel         = Substitute.For <IKernel>();
            _kernel.Resolve <IArchiveService>().Returns(_archiveService);
            _proxy         = Substitute.For <GetDataSoap>();
            _connection    = new ConnectionStub(_proxy);
            _configuration = new ConfigurationStub(globalArchiveOptions);

            var beginArchive = new BeginArchive("name", (options, stream) => { });

            _archiveService.Create(Arg.Any <string>(), Arg.Any <Action <ArchiveCreated> >()).Returns(beginArchive);

            var subject = new PerfionClientImpl(_connection, _configuration, _kernel);

            return(subject);
        }
Example #2
0
 public ConnectionStub(GetDataSoap proxy)
     : base(ConnectionString.FromText("http://server/perfion/getdata.asmx"))
 {
     _proxy = proxy;
 }