Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UserBanDelete"/> class.
        /// </summary>
        /// <param name="ban">The ban.</param>
        public UserBanDelete(UserBan ban)
        {
            if (ban == null)
            {
                throw new ArgumentNullException("ban");
            }

            this.Id = ban.Id;
            this.User = ban.User;
        }
Пример #2
0
        public void Test_UserBanService_InsertOrUpdate()
        {
            var service = this.UserBanService;
            var ban = new UserBan { Reason = "test2" };

            service.InsertOrUpdate(ban);

            Assert.AreEqual(2, ban.Id, "Id");
            Assert.AreEqual("test2", ban.Reason, "Reason");
        }
        public void Test_UserBanCreateOrUpdate_ValueToModel()
        {
            var date = DateTime.Now;

            var value = new UserBanCreateOrUpdate
            {
                Reason = "test",
                Expire = date.ToString("M/d/yyyy", CultureInfo.InvariantCulture),
            };

            var ban = new UserBan();

            value.ValueToModel(ban);

            Assert.AreEqual("test", ban.Reason, "Reason");
            Assert.IsNotNull(ban.Expire, "Expire NotNull");
            Assert.AreEqual(new DateTime(date.Year, date.Month, date.Day, 0, 0, 0), ban.Expire.Value, "Expire");
        }
Пример #4
0
 public void Update(UserBan entity)
 {
 }
Пример #5
0
 public void InsertOrUpdate(UserBan ban, string name)
 {
     ban.User = new User { Name = string.Empty };
 }
Пример #6
0
 public void Insert(UserBan entity)
 {
 }
Пример #7
0
 public void Delete(UserBan entity)
 {
 }