Inheritance: SimTelemetry.Domain.Entities.Engine
Ejemplo n.º 1
0
        public void TestEngine()
        {
            var hasException = false;
            var testEng      = new CarTestEngine("V10 3.0L", "Cosworth", 10, 3000, new Range(3000, 4000),
                                                 new Range(17500, 18500), new List <EngineMode>(), new List <EngineTorque>(),
                                                 new EngineLifetime(new NormalDistrbution(3600, 200),
                                                                    new NormalDistrbution(15000, 100),
                                                                    new NormalDistrbution(100, 5)));

            car.Assign(testEng);


            Assert.IsNotNull(car.Engine);
            Assert.AreEqual(car.Engine, testEng);
            try
            {
                car.Assign(testEng);
            }
            catch (CarAlreadyHasEngineException ex)
            {
                // good
                hasException = true;
            }
            catch (Exception ex)
            {
                // Bad
                Assert.Fail();
            }
            Assert.True(hasException);
        }
Ejemplo n.º 2
0
        public void TestEngine()
        {
            var hasException = false;
            var testEng = new CarTestEngine("V10 3.0L", "Cosworth", 10, 3000, new Range(3000, 4000),
                                            new Range(17500, 18500), new List<EngineMode>(), new List<EngineTorque>(),
                                            new EngineLifetime(new NormalDistrbution(3600, 200),
                                                               new NormalDistrbution(15000, 100),
                                                               new NormalDistrbution(100, 5)));

            car.Assign(testEng);

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