Пример #1
0
        public void IsStateProvidingAdapter_WhenReadWriteAdapter_ShouldReturnTrue()
        {
            var adapterResponse = GetReadWriteAdapter();
            var state           = new ComponentState(adapterResponse);

            var result = state.IsStateProvidingAdapter("Adapter", PowerState.StateName);

            Assert.IsTrue(result);
        }
Пример #2
0
        public void IsStateProvidingAdapter_WhenTwoReadAndOneWrite_ReturnFalseOnWrite()
        {
            var adapterResponse = GetTwoReadOneWriteAdapters();
            var state           = new ComponentState(adapterResponse);

            var result = state.IsStateProvidingAdapter("WriteAdapter", PowerState.StateName);

            Assert.IsFalse(result);
        }
Пример #3
0
        public void IsStateProvidingAdapter_WhenStateNotExists_ShouldReturnFalse()
        {
            var adapterResponse = GetTwoReadOneWriteAdapters();
            var state           = new ComponentState(adapterResponse);

            var result = state.IsStateProvidingAdapter("ReadAdapter", "MissingState");

            Assert.IsFalse(result);
        }
Пример #4
0
        public void IsStateProvidingAdapter_WhenTwoReadAndOneExplicit_ReturnTrueOnExplicit()
        {
            var adapterResponse = GetTwoReadOneWriteAdapters();
            var state           = new ComponentState(adapterResponse);

            var result = state.IsStateProvidingAdapter("ReadAdapter", PowerState.StateName);

            Assert.IsTrue(result);
        }