public void Setup()
        {
            Setup("fakemac", true);
            ExecutableProcessQueue.Expect(x => x.Go()).Repeat.Once();

            SetNetworkInterface = new SetNetworkInterface(ExecutableProcessQueue, WmiMacNetworkNameGetter, Logger, new IPFinder());
        }
 public void should_handle_ip6s_being_null()
 {
     NetworkInterface.ip6s = null;
     ExecutableProcessQueue.Expect(queue => queue.Enqueue(Arg <string> .Is.Equal("netsh"), Arg <string> .Is.Anything)).WhenCalled(ShouldNotHaveIpv6SubCommand).Repeat.Any().Return(null);
     SetNetworkInterface.Execute(new List <NetworkInterface> {
         NetworkInterface
     });
 }
 public void should_try_to_diff_name_if_set_interface_name_fails()
 {
     ExecutableProcessQueue.Expect(x => x.Go()).Throw(new UnsuccessfulCommandExecutionException("something", new ExecutableResult()));
     SetNetworkInterface.Execute(new List <NetworkInterface> {
         NetworkInterface
     });
     ExecutableProcessQueue.AssertWasCalled(
         x => x.Enqueue("netsh", "interface set interface name=\"Lan1\" newname=\"Front End1\""));
 }
        public void Setup()
        {
            Setup("fakemac");
            ExecutableProcessQueue.Expect(x => x.Go()).Repeat.Twice();

            SetNetworkInterface = new SetNetworkInterface(ExecutableProcessQueue, WmiMacNetworkNameGetter, Logger, new IPFinder());
            SetNetworkInterface.Execute(new List <NetworkInterface> {
                NetworkInterface
            });
        }
Exemplo n.º 5
0
        public void Setup()
        {
            Setup("fakemac", false, false, true);
            ExecutableProcessQueue.Expect(x => x.Go()).Repeat.Once();

            SetNetworkInterface = new SetNetworkInterface(ExecutableProcessQueue, WmiMacNetworkNameGetter, Logger);
            SetNetworkInterface.Execute(new List <NetworkInterface> {
                NetworkInterface
            });
        }
        public void should_not_set_diff_name_if_set_interface_name_fails_for_more_than_retry_attempts()
        {
            const int noOfRetries = SetNetworkInterface.NO_OF_RETRIES_FOR_SETTING_INTERFACE_NAME;

            ExecutableProcessQueue.Expect(x => x.Go()).Throw(new UnsuccessfulCommandExecutionException("something", new ExecutableResult())).Repeat.Times(noOfRetries + 1);
            SetNetworkInterface.Execute(new List <NetworkInterface> {
                NetworkInterface
            });
            ExecutableProcessQueue.AssertWasNotCalled(
                x => x.Enqueue("netsh", string.Format("interface set interface name=\"Lan1\" newname=\"Front End{0}\"", noOfRetries + 1)));
        }
Exemplo n.º 7
0
 public void Setup()
 {
     Setup("some_mac_not_found");
     ExecutableProcessQueue.Expect(x => x.Go()).Repeat.Once();
     SetNetworkInterface = new SetNetworkInterface(ExecutableProcessQueue, WmiMacNetworkNameGetter, Logger);
 }