Ejemplo n.º 1
0
        private IEnumerable <SoleTrader> populateSoleTraders()
        {
            var comp1 = new SoleTrader
            {
                Name         = "SoleTrader1",
                AddressLine1 = "addr1",
                AddressLine2 = "addr2",
                AddressLine3 = "addr3"
                ,
                Employments = new List <Employment>
                {
                    new Employment
                    {
                        Employee = new Person
                        {
                            Name = "Employee1",
                        },
                        EmploymentStartDate = Convert.ToDateTime("10/10/2000"),
                        EmploymentEndDate   = Convert.ToDateTime("10/10/2013"),
                    },
                    new Employment
                    {
                        Employee = new Person
                        {
                            Name = "Employee2",
                        },
                        EmploymentStartDate = Convert.ToDateTime("10/10/1988"),
                        EmploymentEndDate   = Convert.ToDateTime("10/10/2003"),
                    },
                    new Employment
                    {
                        Employee = new Person
                        {
                            Name = "Employee3",
                        },
                        EmploymentStartDate = Convert.ToDateTime("10/10/2005"),
                        EmploymentEndDate   = Convert.ToDateTime("01/01/2999"),
                    }
                }
            };


            return(new List <SoleTrader> {
                comp1
            });
        }
Ejemplo n.º 2
0
        public async Task TestGetSoleTrader()
        {
            // Perform API call
            SoleTrader result = null;

            try
            {
                result = await _controller.GetSoleTraderAsync();
            }
            catch (APIException) {};

            // Test response code
            Assert.AreEqual(200, HTTPCallBackHandler.Response.StatusCode,
                            "Status should be 200");

            // Test headers
            var headers = new Dictionary <string, string>();

            headers.Add("Content-Type", "application/json");

            Assert.IsTrue(TestHelper.AreHeadersProperSubsetOf(
                              headers, HTTPCallBackHandler.Response.Headers),
                          "Headers should match");
        }