public void GetYearPercentage_SendValidData_ReturnsResult()
        {
            // Arrange
            var yearService = new YearService();

            // Act
            var result = yearService.GetYearPercentage(2000);

            //Assert
            Assert.Equal((decimal)0.015, result);
        }
Ejemplo n.º 2
0
        private void Bind()
        {
            var yearService = new YearService();

            ddlYearReleased.Items.AddRange(yearService.GetAllPhishYears());

            var item = new ListItem("Please select a year", "-1");

            ddlYearReleased.Items.Add(item);
            item.Selected = true;
        }
        public void GetYearPercentage_SendValidManyData_ReturnsResult(decimal actual, int year)
        {
            // Arrange
            var yearService = new YearService();

            // Act
            var result = yearService.GetYearPercentage(year);

            //Assert
            Assert.Equal(actual, result);
        }
Ejemplo n.º 4
0
        // GET: SearchAuto
        public ActionResult Index()
        {
            breadcrumbs.Add("#", Resource.Search);
            ViewBag.breadcrumbs = breadcrumbs;

            ViewBag.regions            = CityService.GetAllAsSelectList();
            ViewBag.autoTransportTypes = AutoTransportTypeService.GetAllAsSelectList();
            ViewBag.currencies         = CurrencyService.GetAllAsSelectList();
            ViewBag.years = YearService.GetAllAsSelectList();

            return(View());
        }
Ejemplo n.º 5
0
        private void createFoldersButton_Click(object sender, EventArgs e)
        {
            var years = YearService.GetYears();

            foreach (var year in years)
            {
                var dirInfo = new DirectoryInfo(Path.Combine(pathTextBox.Text, year.ToString()));

                dirInfo.CreateDirectory(); // if directory exists does not create it
            }

            MessageBox.Show($"Folders {years.First()} to {years.Last()} created.", "Done", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Ejemplo n.º 6
0
 public YearsController(
     RedisService redis,
     DbService db,
     ArtistService artistService,
     ShowService showService,
     SourceService sourceService,
     YearService yearService
     ) : base(redis, db, artistService)
 {
     _showService   = showService;
     _yearService   = yearService;
     _sourceService = sourceService;
 }
Ejemplo n.º 7
0
        public async Task GetAllAsync_ShouldReturnList()
        {
            // ARRANGE
            var mockContextFactory = SetupContextFactory();

            _sut = new YearService(mockContextFactory.Object);

            // ACT
            var actual = await _sut.GetAllAsync();

            // ASSERT
            Assert.Equal(GetTestYears().Count, actual.Entity.Count);
            Assert.Equal(ComparableObject.Convert(GetTestYears().First()), ComparableObject.Convert(actual.Entity.First()));
        }
Ejemplo n.º 8
0
        public void Setup()
        {
            SetUpContextOptions();

            SetUpJwtOptions();

            SetUpServices();

            SetUpMapper();

            SetUpLogger();

            SetUpContext();

            YearService = new YearService(Context, Mapper, Logger);
        }
Ejemplo n.º 9
0
        //public void btnNext_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        //{
        //    Response.Redirect(LinkBuilder.ProfileStep2Link());
        //}

        //public void btnPrevious_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        //{
        //    Response.Redirect(LinkBuilder.ChangeProfileLink());
        //}

        private void BindLists()
        {
            var yearService = new YearService();

            var item = new ListItem("Please select a year", "-1");

            ddlFavoriteYear.Items.AddRange(yearService.GetAllPhishYears());
            ddlFavorite3Year.Items.AddRange(yearService.GetPhish3Point0Years());

            ddlFavoriteYear.Items.Insert(0, item);
            ddlFavorite3Year.Items.Insert(0, item);

            item.Selected = true;

            BindSeasons();
            BindRuns();

            var albumService = new AlbumService(Ioc.GetInstance <IAlbumRepository>());
            var albums       = albumService.GetAllAlbumsForDropDown();

            if (albums != null)
            {
                ddlFavoriteAlbums.Items.AddRange(albums);
            }

            item = new ListItem("Please select an album", "-1");

            ddlFavoriteAlbums.Items.Insert(0, item);

            item.Selected = true;

            //var studioSongs = songService.GetAllSongs().Where(y => y.Album.ToLower() != "live only").OrderBy(x => x.SongName).ToList();

            //if (studioSongs != null)
            //{
            //    studioSongs.ForEach(x => ddlFavoriteStudioSong.Items.Add(new ListItem(x.SongName, x.SongId.ToString())));
            //}

            //item = new ListItem("Please select a song", "-1");

            //ddlFavoriteStudioSong.Items.Insert(0, item);

            //item.Selected = true;
        }
Ejemplo n.º 10
0
 public YearController(YearService yearService)
 {
     _yearService = yearService;
 }
Ejemplo n.º 11
0
 public void Constructor_ShouldThrowExceptionWhenArgumentIsNull1()
 {
     Assert.Throws <ArgumentNullException>(() => _sut = new YearService(null));
 }