private bool IsExpectedOutputSignal(string expected,
                                     IRealTimeProbe probe)
 {
     return(string.Compare(expected,
                           probe.GetLog(),
                           StringComparison.InvariantCulture) == 0);
 }
Example #2
0
        public static IRealTimeProbe CreateRealTimeProbe(IAgenda agenda,
                                                         IWire wire)
        {
            WindsorContainer container = GetWindsorContainerFromContext();

            var            factory = container.Resolve <IRealTimeProbeFactory>();
            IRealTimeProbe probe   = factory.Create(agenda,
                                                    wire);

            return(probe);
        }
Example #3
0
        public void GivenProbeOnWire([NotNull] string probeName,
                                     [NotNull] string agendaName,
                                     [NotNull] string wireName)
        {
            IAgenda agenda = GetAgendaFromContext(agendaName);
            IWire   wire   = GetWireFromContext(wireName);

            IRealTimeProbe probe = CreateRealTimeProbe(agenda,
                                                       wire);

            ScenarioContext.Current [probeName] = probe;
        }
Example #4
0
        public void ThenTheProbeProbeOneShouldShowFalse(string probeName,
                                                        bool expected)
        {
            IRealTimeProbe probe = GetRealTimeProbeFromContext(probeName);

            SleepWaitAndDo(() => IsExpectedOutputSignal(expected,
                                                        probe),
                           DoNothing);

            bool actual = probe.GetSignal();

            Assert.AreEqual(expected,
                            actual);
        }
        public void ThenTheLogForProbeShouldShow([NotNull] string probeName,
                                                 [NotNull] string expected)
        {
            IRealTimeProbe probe = GetRealTimeProbeFromContext(probeName);

            SleepWaitAndDo(() => IsExpectedOutputSignal(expected,
                                                        probe),
                           DoNothing);

            string actual = probe.GetLog();

            Assert.AreEqual(expected,
                            actual);
        }
Example #6
0
 private bool IsExpectedOutputSignal(bool expected,
                                     IRealTimeProbe probe)
 {
     return(expected == probe.GetSignal());
 }