Esempio n. 1
0
        public void TestThatObjectMotherBMWWorks()
        {
            var result = ObjectMother.BMW();

            Assert.AreEqual(result.Name, "BMW 3 Series");
            Assert.AreEqual(result.getBasePrice(), 80);
        }
Esempio n. 2
0
        public void TestThatObjectMotherSpawnedCarWorks()
        {
            Car    beamer     = ObjectMother.BMW();
            String nameResult = beamer.Name;

            Assert.AreEqual("Beamer", nameResult);
        }
Esempio n. 3
0
        public void TestThatCarRentalPricesAreCorrectWithObjectMother()
        {
            Car BMW  = ObjectMother.BMW();
            Car Saab = ObjectMother.Saab();

            Assert.AreEqual(80, BMW.getBasePrice());
            Assert.AreEqual(10 * 7 * .8, Saab.getBasePrice());
        }
Esempio n. 4
0
        public void TestObjectMotherWithDatabase()
        {
            IDatabase mockDatabase = mocks.Stub <IDatabase>();

            mockDatabase.Miles = 2000;
            var target = ObjectMother.BMW();

            target.Database = mockDatabase;
            int milesTravled = target.Mileage;

            Assert.AreEqual(2000, milesTravled);
        }
Esempio n. 5
0
        public void TestMileage()
        {
            IDatabase mockDatabase = mocks.Stub <IDatabase>();
            Int32     Mil          = 100;

            mockDatabase.Miles = Mil;
            var target = ObjectMother.BMW();

            target.Database = mockDatabase;
            int miles = target.Mileage;

            Assert.AreEqual(miles, Mil);
        }
Esempio n. 6
0
        public void TestThatCarDoesGetMileageFromDatabaseWithObjectMother()
        {
            IDatabase mockDatabase = mocks.Stub <IDatabase>();
            Int32     Miles        = 100;

            mockDatabase.Miles = Miles;
            var target = ObjectMother.BMW();

            target.Database = mockDatabase;
            int miles = target.Mileage;

            Assert.AreEqual(miles, Miles);
        }
Esempio n. 7
0
        public void TestThatTheCarGetsTheCorrectCarNumberAndThatTheReturnedCarNumberIsPerfectlyCorrectWithoutADoubt()
        {
            IDatabase mockDatabase = mocks.Stub <IDatabase>();

            using (mocks.Record())
            {
                mockDatabase.getCarLocation(15);
                LastCall.Return("foo");
            }
            var target = ObjectMother.BMW();

            target.Database = mockDatabase;
            Assert.AreEqual("foo", target.getCarLocation(15));
        }
Esempio n. 8
0
        public void TestThatTheCarCanCorrectlyTrackHowManyMilesItHasBeenDrivenSinceItWasCreatedInSomeRandomFactoryInDetroitOrChinaIfItIsAJapaneseCarBecauseDetroitIsPrettyMuchDead()
        {
            IDatabase mockDatabase = mocks.Stub <IDatabase>();

            mockDatabase.Miles = 100;

            var target = ObjectMother.BMW();

            target.Database = mockDatabase;

            int mileage = target.Mileage;

            Assert.AreEqual(mileage, 100);
        }
Esempio n. 9
0
        public void TestThatObjectMother()
        {
            IDatabase mockDatabase = mocks.Stub <IDatabase>();
            int       mileage      = 100;

            mockDatabase.Miles = mileage;
            var target = ObjectMother.BMW();

            target.Database = mockDatabase;
            int    miles = target.Mileage;
            String name  = target.Name;

            Assert.AreEqual(miles, mileage);
            Assert.AreEqual("BMW Z4 Roadster", name);
        }
Esempio n. 10
0
        public void TestThatCarDoesGetMileageFromDatabase()
        {
            IDatabase mockDatabase = mocks.Stub <IDatabase>();

            int Mileage = 100;

            mockDatabase.Miles = Mileage;
            var target = ObjectMother.BMW();

            target.Database = mockDatabase;

            int mileCount = target.Mileage;

            Assert.AreEqual(mileCount, Mileage);
        }
Esempio n. 11
0
        public void TestThatMileageISCorrect()
        {
            IDatabase mockDatabase = mocks.Stub <IDatabase>();
            Int32     Miles        = 100;


            mockDatabase.Miles = Miles;

            var target = ObjectMother.BMW();

            target.Database = mockDatabase;

            int mileage = target.Mileage;

            Assert.AreEqual(mileage, Miles);
        }
Esempio n. 12
0
        public void TestThatLocationGetsFromDatabase()
        {
            IDatabase mockDatabase = mocks.Stub <IDatabase>();

            String carLocation = "Earth";

            using (mocks.Record())
            {
                mockDatabase.getCarLocation(23);
                LastCall.Return(carLocation);
            }

            var target = ObjectMother.BMW();

            target.Database = mockDatabase;
            String result;

            result = target.getCarLocation(23);
            Assert.AreEqual(result, carLocation);
        }
Esempio n. 13
0
        public void TestThatTheCarGetsTheCorrectCarNumberAndThatTheReturnedCarNumberIsPerfectlyCorrectWithoutADoubt()
        {
            IDatabase mockDatabase = mocks.Stub <IDatabase>();

            String Loc10  = "On Sriram's Whale, Next To SQL.";
            String Loc150 = "In Sriram's Office";

            using (mocks.Record())
            {
                mockDatabase.getCarLocation(10);
                LastCall.Return(Loc10);

                mockDatabase.getCarLocation(150);
                LastCall.Return(Loc150);
            }

            var target = ObjectMother.BMW();

            target.Database = mockDatabase;

            Assert.AreEqual(Loc10, target.getCarLocation(10));
            Assert.AreEqual(Loc150, target.getCarLocation(150));
        }
Esempio n. 14
0
        public void TestObjectMother()
        {
            var target = ObjectMother.BMW();

            Assert.AreEqual("BMW", target.Name);
        }
Esempio n. 15
0
        public void TestThatObjectMotherWorksProperly()
        {
            var target = ObjectMother.BMW();

            Assert.AreEqual("It's a BMW.", target.Name);
        }
Esempio n. 16
0
        public void TestThatCarHasCorrectBasePriceForTenDays()
        {
            var target = ObjectMother.BMW();

            Assert.AreEqual(80, target.getBasePrice());
        }
Esempio n. 17
0
        public void ObjectMotherTestCarName()
        {
            var target = ObjectMother.BMW();

            Assert.AreEqual(target.Name, "BMW Something");
        }
Esempio n. 18
0
        public void TestThatCarHasCorrectBasePriceForTenDays_ObjectMotherStyle()
        {
            var target = ObjectMother.BMW(); //Car(21)

            Assert.AreEqual(168, target.getBasePrice());
        }
Esempio n. 19
0
        public void TestThatBMWBookingIsCorrectlyPriced()
        {
            var target = ObjectMother.BMW();

            Assert.AreEqual(80, target.getBasePrice());
        }
Esempio n. 20
0
        public void TestThatBMWHasCorrectRental()
        {
            Car bmw = ObjectMother.BMW();

            Assert.AreEqual(80, bmw.getBasePrice());
        }
Esempio n. 21
0
        public void TestObjectMother()
        {
            var target = ObjectMother.BMW();

            Assert.AreEqual(target.Name, "BMW M5 Sports Car");
        }