Пример #1
0
 public BitComparator(IXOr xOr, IAnd and, IOr or, INot not)
 {
     _xOr = xOr;
     _and = and;
     _or  = or;
     _not = not;
 }
Пример #2
0
 public Bus1Factory(IAnd and, INot not, IOr or, IByteFactory byteFactory)
 {
     _and         = and;
     _not         = not;
     _or          = or;
     _byteFactory = byteFactory;
 }
Пример #3
0
 public Stepper(IMemoryGateFactory memoryGateFactory, IAnd and, INot not, IOr or)
 {
     _and         = and;
     _not         = not;
     _or          = or;
     _memoryGates = Enumerable.Range(0, 12).Select(_ => memoryGateFactory.Create()).ToList();
 }
Пример #4
0
 public Bus1(IAnd and, INot not, IOr or, IByteFactory byteFactory, Action <IByte> updateWire)
 {
     _and         = and;
     _not         = not;
     _or          = or;
     _byteFactory = byteFactory;
     _updateWire  = updateWire;
     Input        = _byteFactory.Create(0);
     Output       = _byteFactory.Create(0);
 }
Пример #5
0
 public CpuPinStates(
     IClock clock,
     IStepper stepper,
     IByte instruction,
     Caez caez,
     IAnd and,
     IOr or,
     INot not,
     IDecoder decoder,
     IByteFactory byteFactory)
 {
     _clock       = clock;
     _stepper     = stepper;
     _instruction = instruction;
     _caez        = caez;
     _and         = and;
     _or          = or;
     _not         = not;
     _decoder     = decoder;
     _byteFactory = byteFactory;
 }
Пример #6
0
        /// <summary>
        /// Used to test exception messages in the negative
        /// </summary>
        /// <param name="continuation">Continuation containing exception message to test</param>
        /// <param name="test">Custom function to test the message -- return true if the test should pass</param>
        /// <returns>Another continuation so you can do .And()</returns>
        public static IStringContainContinuation Matching(
            this INot <string> continuation,
            Func <string, bool> test
            )
        {
            var result = Factory.Create <string, ExceptionMessageContainuationToStringContainContinuation>(
                null, continuation as IExpectationContext <string>
                );

            continuation.AddMatcher(s =>
            {
                result.Actual = s;
                var passed    = !test(s);
                return(new MatcherResult(
                           passed,
                           MessageHelpers.MessageForNotMatchResult(
                               passed, s
                               )
                           ));
            });
            return(result);
        }
Пример #7
0
        /// <summary>
        /// Used to test exception messages in the negative
        /// </summary>
        /// <param name="continuation">Continuation containing the exception message</param>
        /// <param name="search">String to search for</param>
        /// <returns>Continuation so you can perform more tests on the message</returns>
        public static IStringContainContinuation Containing(
            this INot <string> continuation,
            string search
            )
        {
            var result = Factory.Create <string, ExceptionMessageContainuationToStringContainContinuation>(
                null, continuation as IExpectationContext <string>
                );

            continuation.AddMatcher(s =>
            {
                result.Actual = s;
                var passed    = !s?.Contains(search) ?? true;
                return(new MatcherResult(
                           passed,
                           MessageHelpers.MessageForNotContainsResult(
                               passed, s, search
                               )
                           ));
            });
            return(result);
        }
Пример #8
0
 public Inverter(INot not, IByteFactory byteFactory)
 {
     _not         = not;
     _byteFactory = byteFactory;
 }
Пример #9
0
 public Decoder(INot not, IAnd and)
 {
     _not = not;
     _and = and;
 }
Пример #10
0
 public Or(INot not, INAnd nAnd)
 {
     _not  = not;
     _nAnd = nAnd;
 }
Пример #11
0
 public IsZeroGate(IOr or, INot not)
 {
     _or  = or;
     _not = not;
 }
Пример #12
0
 public NAnd(INot not, IAnd and)
 {
     _not = not;
     _and = and;
 }