Example #1
0
        public void SortVenues_SortByAddress()
        {
            var mockDataAcces       = new Mock <IDataAccess>();
            var mockFestivalManager = new Mock <IFestivalManager>();

            mockFestivalManager.Setup(f => f.Calendar).Returns(new Calendar(mockDataAcces.Object));
            VenuesOverviewModel Model = new VenuesOverviewModel(mockFestivalManager.Object)
            {
                Venues = GenerateVenues(),
                SortBy = "Address"
            };
            List <string> Expected = new List <string>()
            {
                "1Address", "2Address", "3Address"
            };

            //Act
            var resultVenues = Model.SortVenues(Model.Venues);


            //Assert
            Assert.Equal(Expected[0], resultVenues[0].Address);
            Assert.Equal(Expected[1], resultVenues[1].Address);
            Assert.Equal(Expected[2], resultVenues[2].Address);
        }
Example #2
0
        public void SortVenues_SortByCapacity()
        {
            var mockDataAcces       = new Mock <IDataAccess>();
            var mockFestivalManager = new Mock <IFestivalManager>();

            mockFestivalManager.Setup(f => f.Calendar).Returns(new Calendar(mockDataAcces.Object));
            VenuesOverviewModel Model = new VenuesOverviewModel(mockFestivalManager.Object)
            {
                Venues = GenerateVenues(),
                SortBy = "Capacity"
            };
            List <int> Expected = new List <int>()
            {
                1, 2, 3
            };

            //Act
            var resultVenues = Model.SortVenues(Model.Venues);


            //Assert
            Assert.Equal(Expected[0], resultVenues[0].Capacity);
            Assert.Equal(Expected[1], resultVenues[1].Capacity);
            Assert.Equal(Expected[2], resultVenues[2].Capacity);
        }