コード例 #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
ファイル: Ram.cs プロジェクト: a-m-brewer/ButHowDoItComputer
        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;
 }
コード例 #17
0
        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;
 }