Пример #1
0
        public void TestValidateEngineState()
        {
            EngineState stateA        = EngineState.CreateDummy(disposed: false);
            EngineState stateB        = EngineState.CreateDummy(disposed: false);
            EngineState disposedState = EngineState.CreateDummy(disposed: true);
            EngineState nullState     = null;

            // The new state can be null or valid if the previous state is an invalid value.
            ValidateEngineStateCreation(disposedState, nullState, false);
            ValidateEngineStateCreation(disposedState, stateA, false);
            ValidateEngineStateCreation(nullState, nullState, false);
            ValidateEngineStateCreation(nullState, stateA, false);

            // The new state can never be a disposed state
            ValidateEngineStateCreation(nullState, disposedState, true);
            ValidateEngineStateCreation(disposedState, disposedState, true);
            ValidateEngineStateCreation(stateA, disposedState, true);

            // The previous & new states can match
            ValidateEngineStateCreation(stateA, stateA, false);

            // New & Previous cannot both be valid and different
            ValidateEngineStateCreation(stateA, stateB, true);

            // Previous cannot be valid is new is invalid
            ValidateEngineStateCreation(stateA, disposedState, true);
            ValidateEngineStateCreation(stateA, nullState, true);
        }
Пример #2
0
        public void TestEngineStateAgainstFailedBuildXLEngineResult()
        {
            EngineState state         = EngineState.CreateDummy(disposed: false);
            EngineState disposedState = EngineState.CreateDummy(disposed: true);
            EngineState nullState     = null;

            ValidateFailedBuildXLEngineResult(state);
            ValidateFailedBuildXLEngineResult(disposedState);
            ValidateFailedBuildXLEngineResult(nullState);
        }