示例#1
0
        public void Test_CountryExtension_FlagImage()
        {
            var country = new Country { Title = "United States", Code = "us" };
            var flag = country.FlagImage(this.Context);

            Assert.AreEqual("<img alt=\"United States\" src=\"/images/icons/us.gif\" />", flag.ToString());
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CountryDelete"/> class.
        /// </summary>
        /// <param name="country">The country.</param>
        public CountryDelete(Country country)
        {
            if (country == null)
            {
                throw new ArgumentNullException("country");
            }

            this.Id = country.Id;
            this.Title = country.Title;
        }
示例#3
0
        public void Test_CountryService_InsertOrUpdate()
        {
            var service = this.CountryService;
            var country = new Country { Title = "test3" };

            service.InsertOrUpdate(country);

            Assert.AreEqual(2, country.Id, "Id");
            Assert.AreEqual("test3", country.Title, "Title");
        }
示例#4
0
        public void Test_CountryService_Insert()
        {
            var country = new Country
            {
                Title = "Test 123"
            };

            this.CountryService.Insert(country);

            Assert.AreEqual(2, country.Id, "Id");
            Assert.AreEqual("test-123", country.Slug, "Slug");
        }
        public void Test_CountryCreateOrUpdate_ValueToModel()
        {
            var value = new CountryCreateOrUpdate
            {
                Title = "test",
                Code = "test2"
            };

            var country = new Country();

            value.ValueToModel(country);

            Assert.AreEqual("test", country.Title, "Title");
            Assert.AreEqual("test2", country.Code, "Code");
        }
示例#6
0
 public void Update(Country entity)
 {
 }
示例#7
0
 public void InsertOrUpdate(Country country)
 {
 }
示例#8
0
 public void Insert(Country entity)
 {
 }
示例#9
0
 public void Delete(Country entity)
 {
 }