Inheritance: SimTelemetry.Domain.Entities.Drivetrain
Exemple #1
0
        public void TestDrivetrain()
        {
            var hasException   = false;
            var testDrivetrain = new CarTestDrivetrain(0, 0, 0.3f, 0.7f, 6, new List <float>(), new List <float>(), new List <int>(), 0, DriveTrainSetup.REAR, 0);

            car.Assign(testDrivetrain);

            Assert.IsNotNull(car.Drivetrain);
            Assert.AreEqual(car.Drivetrain, testDrivetrain);
            try
            {
                car.Assign(testDrivetrain);
            }
            catch (CarAlreadyHasDrivetrainException ex)
            {
                // good
                hasException = true;
            }
            catch (Exception ex)
            {
                // Bad
                Assert.Fail();
            }
            Assert.True(hasException);
        }
Exemple #2
0
        public void TestDrivetrain()
        {
            var hasException = false;
            var testDrivetrain = new CarTestDrivetrain(0, 0, 0.3f, 0.7f, 6, new List<float>(), new List<float>(), new List<int>(), 0, DriveTrainSetup.REAR, 0);

            car.Assign(testDrivetrain);

            Assert.IsNotNull(car.Drivetrain);
            Assert.AreEqual(car.Drivetrain, testDrivetrain);
            try
            {
                car.Assign(testDrivetrain);
            }
            catch (CarAlreadyHasDrivetrainException ex)
            {
                // good
                hasException = true;
            }
            catch (Exception ex)
            {
                // Bad
                Assert.Fail();
            }
            Assert.True(hasException);
        }