public void Exercise_GetExpectedTankValues()
        {
            // Arrange
            var target = new WNEfficiencyService();

            // Act
            var actual = target.GetExpectedTankValues();

            // Assert
            Assert.AreNotEqual(0, actual.Version);
            Assert.AreNotEqual(0, actual.Values.Count);
        }
示例#2
0
        public void Exercise_UpdateVehicles()
        {
            // Arrange
            var wargamingApiService = new WargamingApiService();
            var listOfVehicles      = wargamingApiService.GetListOfVehicles();
            var wnEfficiencyService = new WNEfficiencyService();
            var expectedTankValues  = wnEfficiencyService.GetExpectedTankValues();
            var target = new AdminService();

            // Act
            var actual = target.UpsertVehicles(listOfVehicles, expectedTankValues);

            // Assert
            Assert.IsNotNull(actual);
            var total = actual.VehiclesInserted + actual.VehiclesUpdated;

            Assert.AreEqual(total, actual.Total);
            // TODO: We should check the database to ensure there are tanks in the tank table
        }