Пример #1
0
        public void Get_Users_Storage_Sql_Tests_Method()
        {
            SqlStorage.Clear();

            var      date = DateTimeOffset.Now;
            var      guid = Guid.NewGuid();
            UserItem user = new UserItem()
            {
                ChatId             = 12345678,
                DateOfRegistration = date,
                FirstName          = "Null",
                Id      = guid,
                Message = "Null",
                Status  = StatusEnum.Null
            };

            SqlStorage.AddUser(user);

            List <UserItem> userItems = SqlStorage.GetUsers();

            Assert.AreEqual(userItems.Count, 1);
            Assert.AreEqual(userItems[0].ChatId, user.ChatId);
            Assert.AreEqual(userItems[0].DateOfRegistration, user.DateOfRegistration);
            Assert.AreEqual(userItems[0].FirstName, user.FirstName);
            Assert.AreEqual(userItems[0].Id, user.Id);
            Assert.AreEqual(userItems[0].Message, user.Message);
            Assert.AreEqual(userItems[0].Status, user.Status);

            SqlStorage.Clear();
        }