Exemple #1
0
        public void Method_Get_By_Id_Returns_Null_If_Not_Found()
        {
            var storage = new SqlReminderStorageEF(_connectionString);

            var actual = storage.Get(Guid.Empty);

            Assert.IsNull(actual);
        }
Exemple #2
0
        public void Get_By_Status_Method_Returns_2()
        {
            var storage = new SqlReminderStorageEF(_connectionString);

            var actual = storage.Get(ReminderItemStatus.Failed);

            Assert.IsTrue(actual.Count == 2);
        }
Exemple #3
0
        public void Method_UpdateStatus_By_Id_Finally_Update_Status()
        {
            var storage = new SqlReminderStorageEF(_connectionString);

            storage.UpdateStatus(Guid.Parse("66666666-6666-6666-6666-666666666666"), ReminderItemStatus.Awaiting);

            var reminder = storage.Get(Guid.Parse("66666666-6666-6666-6666-666666666666"));

            Assert.AreEqual(ReminderItemStatus.Awaiting, reminder.Status);
        }
Exemple #4
0
        public void Method_Get_Returns_Reminder_By_Id()
        {
            var storage = new SqlReminderStorageEF(_connectionString);

            var reminderItem = storage.Get(Guid.Parse("44444444-4444-4444-4444-444444444444"));

            Assert.AreEqual(Guid.Parse("44444444-4444-4444-4444-444444444444"), reminderItem.Id);
            Assert.AreEqual("Contact_4", reminderItem.ContactId);
            Assert.AreEqual(DateTimeOffset.Parse("2004-04-04 04:04:04"), reminderItem.Date);
            Assert.AreEqual("Message_4", reminderItem.Message);
            Assert.AreEqual(ReminderItemStatus.Failed, reminderItem.Status);
        }
Exemple #5
0
        public void UpdateStatus_Method_With_Ids_Collection_Updates_Corresponded_Items()
        {
            var storage = new SqlReminderStorageEF(_connectionString);

            var ids = new List <Guid>
            {
                new Guid("11111111-1111-1111-1111-111111111111"),
                new Guid("22222222-2222-2222-2222-222222222222"),
                new Guid("33333333-3333-3333-3333-333333333333")
            };

            storage.UpdateStatus(ids, ReminderItemStatus.Failed);

            var actual = storage.Get(ReminderItemStatus.Failed);

            Assert.IsTrue(actual.Select(x => x.Id).Contains(ids[0]));
            Assert.IsTrue(actual.Select(x => x.Id).Contains(ids[1]));
            Assert.IsTrue(actual.Select(x => x.Id).Contains(ids[2]));
        }