Exemplo n.º 1
0
        public void Query_ArchivingDisabledGloballyDisabledOnQuery_DoesNotArchives()
        {
            PerfionClientImpl subject = CreateSubject();

            _proxy.ExecuteQuery(Arg.Any <ExecuteQueryRequest>()).Returns(_executeQueryResponse);

            subject.Query("<query/>", options => options.Disable());

            _archiveService.DidNotReceive().Create(Arg.Any <string>(), Arg.Any <Action <ArchiveCreated> >());
        }
Exemplo n.º 2
0
        public void Query_ArchivingEnabledGloballyEnabledOnQuery_ArchivesLocal()
        {
            PerfionClientImpl subject = CreateSubject(new ArchiveOptions("Global"));

            _proxy.ExecuteQuery(Arg.Any <ExecuteQueryRequest>()).Returns(_executeQueryResponse);

            subject.Query("<query/>", options => options.Named("Local"));

            _archiveService.Received().Create(Arg.Is("Local"), Arg.Any <Action <ArchiveCreated> >());
        }
Exemplo n.º 3
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);
        }