Example #1
0
        public void DeleteCustomer_CorrectResult_StatusTrue()
        {
            #region Preperation

            var customer = ServiceInstance.AddCustomer(new Customer
            {
                FirstName = "Test FirstName",
                LastName  = "Test LastName"
            });

            // Dummy Mock Method Setup
            _dummyServiceAnother.Setup(x => x.DummyAnother(5))
            .Returns(true);

            #endregion

            var expextedResult = new CustomerServiceResponse
            {
                Status  = true,
                Message = "Customer deleted"
            };

            var actualResult = ServiceInstance.DeleteCustomer(customer.Customer.Id);

            Assert.AreEqual(expextedResult.Status, actualResult.Status);
            Assert.AreEqual(expextedResult.Message, actualResult.Message);
        }
Example #2
0
        public void DeleteCustomer_NullEntity_StatusFalse()
        {
            var expextedResult = new CustomerServiceResponse
            {
                Status  = false,
                Message = "Customer not found"
            };

            var actualResult = ServiceInstance.DeleteCustomer(Guid.NewGuid().ToString());

            Assert.AreEqual(expextedResult.Status, actualResult.Status);
            Assert.AreEqual(expextedResult.Message, actualResult.Message);
            Assert.IsNull(actualResult.Customer);
        }
Example #3
0
        public void DeleteCustomer_EmptyId_StatusFalse()
        {
            var expextedResult = new CustomerServiceResponse
            {
                Status  = false,
                Message = "Id cannot be null or empty"
            };

            var actualResult = ServiceInstance.DeleteCustomer(string.Empty);

            Assert.AreEqual(expextedResult.Status, actualResult.Status);
            Assert.AreEqual(expextedResult.Message, actualResult.Message);
            Assert.IsNull(actualResult.Customer);
        }