/// <inheritdoc/>
 public void Dispose()
 {
     if (_azContext != null)
     {
         _azContext.Dispose();
         _azContext = null;
     }
 }
        /// <summary>
        /// Constructs a new instance of <see cref="CommandLinePredictorTests" />
        /// </summary>
        public CommandLinePredictorTests(ModelFixture fixture)
        {
            _fixture   = fixture;
            _azContext = new AzContext();
            var startHistory = $"{AzPredictorConstants.CommandPlaceholder}{AzPredictorConstants.CommandConcatenator}{AzPredictorConstants.CommandPlaceholder}";

            _predictor = new CommandLinePredictor(_fixture.PredictionCollection[startHistory], null, null, _azContext);
        }
        /// <summary>
        /// Constructs a new instance of <see cref="AzPredictorServiceTests"/>
        /// </summary>
        /// <param name="fixture"></param>
        public AzPredictorServiceTests(ModelFixture fixture)
        {
            this._fixture = fixture;
            _azContext    = new AzContext();
            var startHistory = $"{AzPredictorConstants.CommandPlaceholder}{AzPredictorConstants.CommandConcatenator}{AzPredictorConstants.CommandPlaceholder}";

            this._commandBasedPredictor = new CommandLinePredictor(this._fixture.PredictionCollection[startHistory], null, null, _azContext);
            this._fallbackPredictor     = new CommandLinePredictor(this._fixture.CommandCollection, null, null, _azContext);

            this._service = new MockAzPredictorService(startHistory, this._fixture.PredictionCollection[startHistory], this._fixture.CommandCollection, _azContext);

            this._noFallbackPredictorService     = new MockAzPredictorService(startHistory, this._fixture.PredictionCollection[startHistory], null, _azContext);
            this._noCommandBasedPredictorService = new MockAzPredictorService(null, null, this._fixture.CommandCollection, _azContext);
            this._noPredictorService             = new MockAzPredictorService(null, null, null, null);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Creates a new instance of <see cref="ParameterSetTests" />.
 /// </summary>
 public ParameterSetTests()
 {
     _powerShellRuntime = new MockPowerShellRuntime();
     _azContext         = new AzContext(_powerShellRuntime);
 }