public void WhenConstructingWithResolver_ThenSuccessful()
        {
            this.SetupResolverAndDatabase();
            VehicleManufacturerRepository actual = new VehicleManufacturerRepository(this.dbContext);

            Assert.NotNull(actual);
        }
        public void WhenGetModelsWithInvalidMake_ReturnsNull()
        {
            this.SetupResolverAndDatabase();
            VehicleManufacturerRepository target = new VehicleManufacturerRepository(this.dbContext);

            string[] actual = target.GetModels(2011, "HotWheels");

            Assert.Null(actual);
        }
        public void WhenGetMakesWithInvalidYear_ReturnsNull()
        {
            this.SetupResolverAndDatabase();
            VehicleManufacturerRepository target = new VehicleManufacturerRepository(this.dbContext);

            string[] actual = target.GetMakes(3211);

            Assert.Null(actual);
        }
        public void WhenGetMakesWithValidYear_ReturnsMakes()
        {
            this.SetupResolverAndDatabase();
            VehicleManufacturerRepository target = new VehicleManufacturerRepository(this.dbContext);

            string[] actual = target.GetMakes(2011);

            Assert.NotNull(actual);
            Assert.NotEqual(0, actual.Length);
        }
        public void WhenGetYears_ReturnsYears()
        {
            this.SetupResolverAndDatabase();
            VehicleManufacturerRepository target = new VehicleManufacturerRepository(this.dbContext);

            int[] actual = target.GetYears();

            Assert.NotNull(actual);
            Assert.NotEqual(0, actual.Length);
        }
 public void WhenConstructedWithNullResolver_ThenThrows()
 {
     Assert.Throws<ArgumentNullException>(
         () => { var repository = new VehicleManufacturerRepository(null); });
 }
        public void WhenIsValidYearWithValidYear_ReturnsTrue()
        {
            this.SetupResolverAndDatabase();
            VehicleManufacturerRepository target = new VehicleManufacturerRepository(this.dbContext);

            bool actual = target.IsValidYear(2010);

            Assert.True(actual);
        }
        public void WhenIsValidModelWithInvalidYear_ReturnsFalse()
        {
            this.SetupResolverAndDatabase();
            VehicleManufacturerRepository target = new VehicleManufacturerRepository(this.dbContext);

            bool actual = target.IsValidModel(3022, "Audi", "A4");

            Assert.False(actual);
        }
        public void WhenIsValidMakeWithInvalidMake_ReturnsFalse()
        {
            this.SetupResolverAndDatabase();
            VehicleManufacturerRepository target = new VehicleManufacturerRepository(this.dbContext);

            bool actual = target.IsValidMake(2010, "Innee");

            Assert.False(actual);
        }