Example #1
0
        public ResetNetwork(ISetNetworkInterface setNetworkInterface, IXenNetworkInformation xenNetworkInformation, ISetNetworkRoutes setNetworkRoutes,
                            ISetProviderData setProviderData, IXenProviderDataInformation xenProviderDataInformation, ISetHostnameAction setHostname, IXenStore xenStore, IXenUserMetadata xenUserMetadata)
        {
            _setNetworkInterface   = setNetworkInterface;
            _xenNetworkInformation = xenNetworkInformation;
            _setNetworkRoutes      = setNetworkRoutes;

            _setProviderData            = setProviderData;
            _xenProviderDataInformation = xenProviderDataInformation;
            _setHostname     = setHostname;
            _xenStore        = xenStore;
            _xenUserMetadata = xenUserMetadata;
        }
        public ResetNetwork(ISetNetworkInterface setNetworkInterface, IXenNetworkInformation xenNetworkInformation, ISetNetworkRoutes setNetworkRoutes, 
            ISetProviderData setProviderData, IXenProviderDataInformation xenProviderDataInformation, ISetHostnameAction setHostname, IXenStore xenStore, IXenUserMetadata xenUserMetadata)
        {
            _setNetworkInterface = setNetworkInterface;
            _xenNetworkInformation = xenNetworkInformation;
            _setNetworkRoutes = setNetworkRoutes;

            _setProviderData = setProviderData;
            _xenProviderDataInformation = xenProviderDataInformation;
            _setHostname = setHostname;
            _xenStore = xenStore;
            _xenUserMetadata = xenUserMetadata;
        }
Example #3
0
        internal void Setup()
        {
            NetshFirewallRuleNameAvailable = MockRepository.GenerateMock <INetshFirewallRuleNameAvailable>();
            XenUserMetadata = MockRepository.GenerateMock <IXenUserMetadata>();
            Logger          = MockRepository.GenerateMock <ILogger>();

            XenUserMetadata.Stub(a => a.GetKeys()).Return(new List <string>());
            ExecutableProcessQueue = MockRepository.GenerateMock <IExecutableProcessQueue>();
            ExecutableProcessQueue.Stub(x => x.Enqueue(Arg <string> .Is.Anything, Arg <string> .Is.Anything)).Return(
                ExecutableProcessQueue);

            SetProviderData = new SetProviderData(ExecutableProcessQueue, NetshFirewallRuleNameAvailable, Logger);
            UserMetadata    = new List <string>();
            ProviderData    = GetProviderDataWithFakeRoles();
        }
        public void Setup()
        {
            xenNetworkInformation = MockRepository.GenerateMock<IXenNetworkInformation>();
            xenUserMetadata = MockRepository.GenerateMock<IXenUserMetadata>();
            setNetworkInterface = MockRepository.GenerateMock<ISetNetworkInterface>();
            setNetworkRoutes = MockRepository.GenerateMock<ISetNetworkRoutes>();

            xenProviderDataInformation = MockRepository.GenerateMock<IXenProviderDataInformation>();
            setProviderData = MockRepository.GenerateMock<ISetProviderData>();
            setHostname = MockRepository.GenerateMock<ISetHostnameAction>();
            _xenStore = MockRepository.GenerateMock<IXenStore>();

            networkInterface = new NetworkInterface();
            network = new Network();
            network.Interfaces.Add("fakemac", networkInterface);

            providerData = new ProviderData();
            userMetadata = new List<string>();

            command = new ResetNetwork(setNetworkInterface, xenNetworkInformation, setNetworkRoutes, setProviderData, xenProviderDataInformation, setHostname, _xenStore, xenUserMetadata);
        }
        public void Setup()
        {
            xenNetworkInformation = MockRepository.GenerateMock <IXenNetworkInformation>();
            xenUserMetadata       = MockRepository.GenerateMock <IXenUserMetadata>();
            setNetworkInterface   = MockRepository.GenerateMock <ISetNetworkInterface>();
            setNetworkRoutes      = MockRepository.GenerateMock <ISetNetworkRoutes>();

            xenProviderDataInformation = MockRepository.GenerateMock <IXenProviderDataInformation>();
            setProviderData            = MockRepository.GenerateMock <ISetProviderData>();
            setHostname = MockRepository.GenerateMock <ISetHostnameAction>();
            _xenStore   = MockRepository.GenerateMock <IXenStore>();


            networkInterface = new NetworkInterface();
            network          = new Network();
            network.Interfaces.Add("fakemac", networkInterface);

            providerData = new ProviderData();
            userMetadata = new List <string>();

            command = new ResetNetwork(setNetworkInterface, xenNetworkInformation, setNetworkRoutes, setProviderData, xenProviderDataInformation, setHostname, _xenStore, xenUserMetadata);
        }
        internal void Setup()
        {
            NetshFirewallRuleNameAvailable = MockRepository.GenerateMock<INetshFirewallRuleNameAvailable>();
            XenUserMetadata = MockRepository.GenerateMock<IXenUserMetadata>();
            Logger = MockRepository.GenerateMock<ILogger>();

            XenUserMetadata.Stub(a => a.GetKeys()).Return(new List<string>());
            ExecutableProcessQueue = MockRepository.GenerateMock<IExecutableProcessQueue>();
            ExecutableProcessQueue.Stub(x => x.Enqueue(Arg<string>.Is.Anything, Arg<string>.Is.Anything)).Return(
                ExecutableProcessQueue);

            SetProviderData = new SetProviderData(ExecutableProcessQueue, NetshFirewallRuleNameAvailable, Logger);
            UserMetadata = new List<string>();
            ProviderData = GetProviderDataWithFakeRoles();
        }