Exemplo n.º 1
0
        public void DriverTraits_SetTo_DriverResult()
        {
            // Arrange
            DriverResult driverResult = new DriverResult();
            DriverTrait  driverTrait1 = new DriverTrait {
                Trait = new Trait {
                    QualyPace = 1
                }
            };
            DriverTrait driverTrait2 = new DriverTrait {
                Trait = new Trait {
                    QualyPace = 2
                }
            };
            List <DriverTrait> driverTraits = new List <DriverTrait> {
                driverTrait1, driverTrait2
            };
            Weather weather = Weather.Sunny;

            // Act
            RaceService.SetDriverTraitMods(driverResult, driverTraits, weather);
            // Assert
            int expected = 3; // QualyMod should add up all QualyPace which results in an expected of 3

            Assert.Equal(expected, driverResult.QualyMod);
        }
Exemplo n.º 2
0
 public async Task AddTraitToDriver(Driver driver, Trait trait)
 {
     DriverTrait newTrait = new DriverTrait {
         Driver = driver, Trait = trait
     };
     await Context.AddAsync(newTrait);
 }