/// <summary>
        /// Given certain conditions.
        /// </summary>
        protected override void Given()
        {
            this.databaseRecords = new[]
                     {
                         new Data.Entities.Country(),
                         new Data.Entities.Country(),
                         new Data.Entities.Country()
                     };

            this.repositoryMock.Setup(a => a.GetAll()).Returns(databaseRecords);
            this.mapperMock.Setup(a => a.Map(this.databaseRecords[0])).Returns(new Country { Name = "UK" });
            this.mapperMock.Setup(a => a.Map(this.databaseRecords[1])).Returns(new Country { Name = "France" });
            this.mapperMock.Setup(a => a.Map(this.databaseRecords[2])).Returns(new Country { Name = "Poland" });

            this.classUnderTest = new GetCountriesDirector(this.repositoryMock.Object, this.mapperMock.Object);
        }
示例#2
0
        /// <summary>
        /// Given certain conditions.
        /// </summary>
        protected override void Given()
        {
            this.databaseRecords = new[]
            {
                new Data.Entities.Country(),
                new Data.Entities.Country(),
                new Data.Entities.Country()
            };

            this.repositoryMock.Setup(a => a.GetAll()).Returns(databaseRecords);
            this.mapperMock.Setup(a => a.Map(this.databaseRecords[0])).Returns(new Country {
                Name = "UK"
            });
            this.mapperMock.Setup(a => a.Map(this.databaseRecords[1])).Returns(new Country {
                Name = "France"
            });
            this.mapperMock.Setup(a => a.Map(this.databaseRecords[2])).Returns(new Country {
                Name = "Poland"
            });

            this.classUnderTest = new GetCountriesDirector(this.repositoryMock.Object, this.mapperMock.Object);
        }