Beispiel #1
0
        public void GetCustomer_NullEntity_StatusFalse()
        {
            var expextedResult = new CustomerServiceResponse
            {
                Status  = false,
                Message = "Customer not found"
            };

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

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

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

            Assert.AreEqual(expextedResult.Status, actualResult.Status);
            Assert.AreEqual(expextedResult.Message, actualResult.Message);
            Assert.IsNull(actualResult.Customer);
        }
Beispiel #3
0
        public void GetCustomer_CorrectResult_StatusTrue()
        {
            #region Preperation

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

            #endregion

            var expextedResult = new CustomerServiceResponse
            {
                Status = true
            };

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

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