public void TheFirstAmountMustBeOneOrGreater()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ListBuilderExtensions.TheFirst(listBuilderImpl, 0);
     });
 }
Esempio n. 2
0
        public void TheFirstAmountShouldBeLessThanListCapacity()
        {
            using (mocks.Record())
                listBuilderImpl.Expect(x => x.Capacity).Return(10);

            ListBuilderExtensions.TheFirst(listBuilderImpl, 11);
        }
        public void TheFirstAmountShouldBeLessThanListCapacity()
        {
            listBuilderImpl.Capacity.Returns(10);

            Assert.Throws <ArgumentException>(() =>
            {
                ListBuilderExtensions.TheFirst(listBuilderImpl, 11);
            });
        }
        public void TheFirstAmountShouldBeLessThanListCapacity()
        {
            using (mocks.Record())
                listBuilderImpl.Expect(x => x.Capacity).Return(10);

            Assert.Throws <ArgumentException>(() =>
            {
                ListBuilderExtensions.TheFirst(listBuilderImpl, 11);
            });
        }
        public void TheFirstShouldReturnARangeDeclaration()
        {
            var rangeDeclaration = new RangeDeclaration <MyClass>(listBuilderImpl, null, 0, 0);

            listBuilderImpl.Capacity.Returns(30);
            listBuilderImpl.CreateObjectBuilder().Returns((IObjectBuilder <MyClass>)null);
            listBuilderImpl.AddDeclaration(Arg.Is <RangeDeclaration <MyClass> >(y => y.Start == 0 && y.End == 9)).Returns(rangeDeclaration);

            var declaration = ListBuilderExtensions.TheFirst(listBuilderImpl, 10);

            Assert.That(declaration, Is.SameAs(rangeDeclaration));
        }
        public void TheFirstShouldReturnARangeDeclaration()
        {
            var rangeDeclaration = new RangeDeclaration <MyClass>(listBuilderImpl, null, 0, 0);

            using (mocks.Record())
            {
                listBuilderImpl.Expect(x => x.Capacity).Return(30);
                listBuilderImpl.Expect(x => x.CreateObjectBuilder()).Return(null);
                listBuilderImpl.Expect(x => x.AddDeclaration(Arg <RangeDeclaration <MyClass> > .Matches(y => y.Start == 0 && y.End == 9))).Return(rangeDeclaration);
            }

            using (mocks.Playback())
            {
                var declaration = ListBuilderExtensions.TheFirst(listBuilderImpl, 10);
                Assert.That(declaration, Is.SameAs(rangeDeclaration));
            }
        }
Esempio n. 7
0
 public void TheFirstAmountMustBeOneOrGreater()
 {
     ListBuilderExtensions.TheFirst(listBuilderImpl, 0);
 }