예제 #1
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();
 }
예제 #2
0
 public BitComparator(IXOr xOr, IAnd and, IOr or, INot not)
 {
     _xOr = xOr;
     _and = and;
     _or  = or;
     _not = not;
 }
예제 #3
0
 /// <summary>
 /// Tests the type on a property With continuation
 /// </summary>
 /// <param name="with"></param>
 /// <param name="expected"></param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 public static IMore <T> Type <T>(
     this IAnd <T> with,
     Type expected
     )
 {
     return(with.Type(expected, NULL_STRING));
 }
예제 #4
0
 /// <summary>
 /// Continues testing a named property for an expected value
 /// </summary>
 /// <param name="with"></param>
 /// <param name="expected"></param>
 /// <typeparam name="T"></typeparam>
 public static IMore <T> Value <T>(
     this IAnd <T> with,
     object expected
     )
 {
     return(with.Value <T>(expected, NULL_STRING));
 }
예제 #5
0
 public Bus1Factory(IAnd and, INot not, IOr or, IByteFactory byteFactory)
 {
     _and         = and;
     _not         = not;
     _or          = or;
     _byteFactory = byteFactory;
 }
예제 #6
0
 /// <summary>
 /// Tests if an object has a given property, may continue on to test
 /// the property value
 /// </summary>
 /// <param name="have"></param>
 /// <param name="property"></param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 public static IMore <T> Property <T>(
     this IAnd <T> have,
     string property
     )
 {
     return(have.Property(property, NULL_STRING));
 }
예제 #7
0
 /// <summary>
 /// Tests if an object has a given property, may continue on to test
 /// the property value
 /// </summary>
 /// <param name="have"></param>
 /// <param name="property"></param>
 /// <param name="customMessage"></param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 public static IMore <T> Property <T>(
     this IAnd <T> have,
     string property,
     string customMessage
     )
 {
     return(have.Property(property, () => customMessage));
 }
예제 #8
0
 /// <summary>
 /// Tests if an object has a given property, may continue on to test
 /// the property value
 /// </summary>
 /// <param name="have"></param>
 /// <param name="property"></param>
 /// <param name="customMessageGenerator"></param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 /// <exception cref="InvalidOperationException"></exception>
 public static IMore <T> Property <T>(
     this IAnd <T> have,
     string property,
     Func <string> customMessageGenerator
     )
 {
     return((have as ICanAddMatcher <T>).Property(property, customMessageGenerator));
 }
예제 #9
0
 /// <summary>
 /// Continues testing a named property for an expected value
 /// </summary>
 /// <param name="with"></param>
 /// <param name="expected"></param>
 /// <param name="customMessage"></param>
 /// <typeparam name="T"></typeparam>
 public static IMore <T> Value <T>(
     this IAnd <T> with,
     object expected,
     string customMessage
     )
 {
     return(with.Value(expected, () => customMessage));
 }
예제 #10
0
 /// <summary>
 /// Tests the type on a property With continuation
 /// </summary>
 /// <param name="with"></param>
 /// <param name="expected"></param>
 /// <param name="customMessage"></param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 public static IMore <T> Type <T>(
     this IAnd <T> with,
     Type expected,
     string customMessage
     )
 {
     return(with.Type(expected, () => customMessage));
 }
예제 #11
0
 /// <summary>
 /// Tests the type on a property With continuation
 /// </summary>
 /// <param name="with"></param>
 /// <param name="expected"></param>
 /// <param name="customMessageGenerator"></param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 public static IMore <T> Type <T>(
     this IAnd <T> with,
     Type expected,
     Func <string> customMessageGenerator
     )
 {
     return((with as ICanAddMatcher <T>).Type(expected, customMessageGenerator));
 }
예제 #12
0
 public Clock(IClockStateFactory clockStateFactory, IAnd and, IOr or)
 {
     _and  = and;
     _or   = or;
     _clk  = clockStateFactory.Create();
     _clkD = clockStateFactory.Create();
     ClkE  = false;
     ClkS  = false;
 }
예제 #13
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);
 }
예제 #14
0
 public static IMore <T> Color <T>(
     this IAnd <T> have,
     Colors color
     ) where T : Animal
 {
     have.Compose(animal =>
     {
         Expect(animal.Colors).To.Contain.Exactly(1).Equal.To(color);
     });
     return(have.More());
 }
예제 #15
0
        public Ram(IBus <IByte> outputBus, IByteRegisterFactory byteRegisterFactory,
                   IDecoder decoder, IAnd and)
        {
            Io = outputBus;
            _byteRegisterFactory = byteRegisterFactory;
            _decoder             = decoder;
            _and = and;

            Set    = false;
            Enable = false;

            SetupInputRegister();
            SetupInternalRegisters();
        }
예제 #16
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;
 }
        public ArithmeticLogicUnit(
            IByteXOr byteXOr,
            IByteOr byteOr,
            IByteAnd byteAnd,
            IInverter inverter,
            IByteAdder byteAdder,
            IByteEnabler byteEnabler,
            IAnd and,
            IIsZeroGate isZeroGate,
            IByteDecoder byteDecoder,
            IRightByteShifter rightByteShifter,
            ILeftByteShifter leftByteShifter,
            IOr or,
            IAluWire aluWire,
            IByteComparator byteComparator,
            Action <Caez> updateFlags,
            Action <IByte> updateAcc,
            IByteFactory byteFactory)
        {
            _byteXOr          = byteXOr;
            _byteOr           = byteOr;
            _byteAnd          = byteAnd;
            _inverter         = inverter;
            _byteAdder        = byteAdder;
            _byteEnabler      = byteEnabler;
            _and              = and;
            _isZeroGate       = isZeroGate;
            _byteDecoder      = byteDecoder;
            _rightByteShifter = rightByteShifter;
            _leftByteShifter  = leftByteShifter;
            _or             = or;
            _aluWire        = aluWire;
            _byteComparator = byteComparator;
            _updateFlags    = updateFlags;
            _updateAcc      = updateAcc;

            InputA = byteFactory.Create();
            InputB = byteFactory.Create();
            Op     = new Op();
        }
예제 #18
0
 public Decoder(INot not, IAnd and)
 {
     _not = not;
     _and = and;
 }
예제 #19
0
 public CaezRegisterFactory(IMemoryGateFactory memoryGateFactory, IAnd and)
 {
     _memoryGateFactory = memoryGateFactory;
     _and = and;
 }
예제 #20
0
 public CaezEnabler(IAnd and)
 {
     _and = and;
 }
예제 #21
0
 public BitRegister(IMemoryGate memoryGate, IAnd and, Action <bool> updateWire)
 {
     _memoryGate = memoryGate;
     _and        = and;
     _updateWire = updateWire;
 }
예제 #22
0
 public ByteEnabler(IAnd andGate, IByteFactory byteFactory)
 {
     _andGate     = andGate;
     _byteFactory = byteFactory;
 }
예제 #23
0
 public ByteAnd(IAnd and, IByteFactory byteFactory)
 {
     _and         = and;
     _byteFactory = byteFactory;
 }
예제 #24
0
 public NAnd(INot not, IAnd and)
 {
     _not = not;
     _and = and;
 }
예제 #25
0
 public BitAdder(IXOr xOr, IOr or, IAnd and)
 {
     _xOr = xOr;
     _or  = or;
     _and = and;
 }