Esempio n. 1
0
        public void should_be_initially_empty_and_not_reserved()
        {
            var buffer = MockRepository.GenerateStub<IBuffer>();
            var channel = new Channel(buffer);

            channel.IsFull().Should().Be.False();
            channel.IsReservedForOtherThan(new Flit()).Should().Be.False();
        }
Esempio n. 2
0
        public void should_be_full_when_buffer_is_also_full()
        {
            var buffer = MockRepository.GenerateMock<IBuffer>();
            var channel = new Channel(buffer);

            buffer.Expect(x => x.IsFull()).Return(true);

            channel.IsFull().Should().Be.True();
            buffer.VerifyAllExpectations();
        }
Esempio n. 3
0
        public void should_be_marked_as_reserved_after_reservation()
        {
            var buffer = MockRepository.GenerateStub<IBuffer>();
            var channel = new Channel(buffer);
            var flit = new Flit();

            channel.Reserve(flit);

            channel.IsReservedForOtherThan(flit).Should().Be.False();
            channel.IsReservedForOtherThan(new Flit()).Should().Be.True();
        }