Example #1
0
        public void LogRepositoryMock_Create_Valid_Item_Should_Pass()
        {
            // Arange
            var myData = new LogRepositoryMock();

            // Get the first item from the list
            var oldItem = new LogModel();

            oldItem.ID               = "ID";
            oldItem.PhoneID          = "PhoneID";
            oldItem.RecordedDateTime = DateTime.Parse("23/01/2019");
            oldItem.Value            = "Value";


            // Act
            var newItem = myData.Create(oldItem);

            // Check each item one by one to ensure it is correctly loaded

            // Assert
            Assert.AreEqual(oldItem.ID, newItem.ID);
            Assert.AreEqual(oldItem.PhoneID, newItem.PhoneID);
            Assert.AreEqual(oldItem.RecordedDateTime, newItem.RecordedDateTime);
            Assert.AreEqual(oldItem.Value, newItem.Value);
        }
Example #2
0
        public void LogRepositoryMock_Create_InValid_Null_Should_Fail()
        {
            // Arange
            var myData = new LogRepositoryMock();

            // Act
            var newItem = myData.Create(null);

            // Check each item one by one to ensure it is correctly loaded

            // Assert
            Assert.AreEqual(null, newItem);
        }