Пример #1
0
        public void Should_GetVenues()
        {
            // mock UoW and repository data
            Mock <IUnitOfWork> mock = new Mock <IUnitOfWork>();

            mock.Setup(f => f.Venues.Get()).Returns(new List <Venue>
            {
                new Venue
                {
                    Id           = 1,
                    Address1     = "Addr1",
                    Address2     = "Addr2",
                    Address3     = "Addr3",
                    Address4     = "Addr4",
                    Address5     = "Addr5",
                    Description  = "Test",
                    ContactPhone = "01234567898",
                    Image        = "",
                    LatLong      = "0,0",
                    Name         = "Test",
                    Instagram    = "inst",
                    Facebook     = "fb",
                    Twitter      = "tw"
                },
                new Venue
                {
                    Id           = 1,
                    Address1     = "Addr1",
                    Address2     = "Addr2",
                    Address3     = "Addr3",
                    Address4     = "Addr4",
                    Address5     = "Addr5",
                    Description  = "Test",
                    ContactPhone = "01234567898",
                    Image        = "",
                    LatLong      = "0,0",
                    Name         = "Test",
                    Instagram    = "inst",
                    Facebook     = "fb",
                    Twitter      = "tw"
                },
                new Venue
                {
                    Id           = 1,
                    Address1     = "Addr1",
                    Address2     = "Addr2",
                    Address3     = "Addr3",
                    Address4     = "Addr4",
                    Address5     = "Addr5",
                    Description  = "Test",
                    ContactPhone = "01234567898",
                    Image        = "",
                    LatLong      = "0,0",
                    Name         = "Test",
                    Instagram    = "inst",
                    Facebook     = "fb",
                    Twitter      = "tw"
                }
            }
                                                    .AsQueryable());

            VenuesController controller = new VenuesController(mock.Object);
            var venues = controller.GetVenues();

            Assert.True(venues.Count() == 3);
        }