Beispiel #1
0
        static UnitTestBase()
        {
            // Enable TLS1.2 for all tests.
            System.Net.ServicePointManager.SecurityProtocol = System.Net.ServicePointManager.SecurityProtocol
                                                              | System.Net.SecurityProtocolType.Tls12;

            ProjectTestMode = UnitTestMode.Replay;
        }
Beispiel #2
0
        protected static ProxyMode Translate(UnitTestMode mode)
        {
            switch (mode)
            {
            case UnitTestMode.Capture:
                return(ProxyMode.DataCapture);

            case UnitTestMode.NoProxy:
                return(ProxyMode.DataPassthrough);

            case UnitTestMode.Replay:
                return(ProxyMode.DataReplay);
            }

            throw new InvalidOperationException($"'{mode}' is an undefined value of `{nameof(UnitTestMode)}`");
        }