Пример #1
0
        public void Exercise_GetListOfVehicles()
        {
            // Arrange
            var target = new WargamingApiService();

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

            // Assert
            Assert.AreEqual("ok", actual.Status);
            Assert.IsTrue(actual.Count > 0);
            Assert.AreEqual(actual.Count, actual.Tanks.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
        }