public void GetRandomRide_NoRide_ExpectNull()
        {
            HttpClient httpClient = HttpClientMockHelper.GetMockedHttpClient(JsonConvert.SerializeObject(""), System.Net.HttpStatusCode.NotFound);
            var        rideClient = new RideClient(httpClient);

            var result = rideClient.GetRandomRide();

            Assert.Null(result);
        }
        public void GetRandomRide_ExistingRide_ExpectRide()
        {
            HttpClient httpClient = HttpClientMockHelper.GetMockedHttpClient(JsonConvert.SerializeObject(new RideDto()));
            var        rideClient = new RideClient(httpClient);

            var result = rideClient.GetRandomRide();

            Assert.NotNull(result);
        }
        public void GetNearestFairyTale_ExistingFairyTale_ExpectFairyTale()
        {
            HttpClient httpClient      = HttpClientMockHelper.GetMockedHttpClient(JsonConvert.SerializeObject(new FairyTaleDto()));
            var        fairyTaleClient = new FairyTaleClient(httpClient);

            var result = fairyTaleClient.GetNewFairyTaleLocation(Guid.NewGuid(), new List <Guid>());

            Assert.NotNull(result);
        }
        public void GetNearestRide_ExistingRide_ExpectRide()
        {
            HttpClient httpClient = HttpClientMockHelper.GetMockedHttpClient(JsonConvert.SerializeObject(new RideDto()));
            var        rideClient = new RideClient(httpClient);

            var result = rideClient.GetNextLocation(Guid.NewGuid(), new List <Guid>());

            Assert.NotNull(result);
        }
        public void GetVisitor_NoVisitor_ExpectNull()
        {
            HttpClient httpClient    = HttpClientMockHelper.GetMockedHttpClient(JsonConvert.SerializeObject(""), System.Net.HttpStatusCode.NotFound);
            var        visitorClient = new VisitorClient(httpClient);

            var result = visitorClient.GetVisitor(Guid.NewGuid());

            Assert.Null(result);
        }
        public void GetRandomFairyTale_ExistingFairyTale_ExpectFairyTale()
        {
            HttpClient httpClient      = HttpClientMockHelper.GetMockedHttpClient(JsonConvert.SerializeObject(new FairyTaleDto()));
            var        fairyTaleClient = new FairyTaleClient(httpClient);

            var result = fairyTaleClient.GetRandomFairyTale();

            Assert.NotNull(result);
        }
        public void GetNearestRide_NoRide_ExpectNull()
        {
            HttpClient httpClient = HttpClientMockHelper.GetMockedHttpClient(JsonConvert.SerializeObject(""), System.Net.HttpStatusCode.NotFound);
            var        rideClient = new RideClient(httpClient);

            var result = rideClient.GetNextLocation(Guid.NewGuid(), new List <Guid>());

            Assert.Null(result);
        }
        public void GetVisitor_ExistingVisitor_ExpectVisitor()
        {
            HttpClient httpClient    = HttpClientMockHelper.GetMockedHttpClient(JsonConvert.SerializeObject(new VisitorDto()));
            var        visitorClient = new VisitorClient(httpClient);

            var result = visitorClient.GetVisitor(Guid.NewGuid());

            Assert.NotNull(result);
        }
        public void GetRides_NoRides_ExpectEmptyList()
        {
            HttpClient httpClient = HttpClientMockHelper.GetMockedHttpClient("[]");

            var rideClient = new RideClient(httpClient);

            var result = rideClient.GetRides();

            Assert.Empty(result);
        }
        public void GetStands_NoStands_ExpectEmptyList()
        {
            HttpClient httpClient = HttpClientMockHelper.GetMockedHttpClient("[]");

            var standClient = new StandClient(httpClient);

            var result = standClient.GetStands();

            Assert.Empty(result);
        }
        public void GetFairyTales_NoFairyTales_ExpectEmptyList()
        {
            HttpClient httpClient = HttpClientMockHelper.GetMockedHttpClient("[]");

            var fairyTaleClient = new FairyTaleClient(httpClient);

            var result = fairyTaleClient.GetFairyTales();

            Assert.Empty(result);
        }
Beispiel #12
0
        public void GetEmployees_NoEmployees_ExpectEmptyList()
        {
            HttpClient httpClient = HttpClientMockHelper.GetMockedHttpClient("[]");

            var employeeClient = new EmployeeClient(httpClient);

            var result = employeeClient.GetEmployees();

            Assert.Empty(result);
        }
        public void GetVisitors_NoVisitors_ExpectEmptyList()
        {
            HttpClient httpClient = HttpClientMockHelper.GetMockedHttpClient("[]");

            var visitorClient = new VisitorClient(httpClient);

            var result = visitorClient.GetVisitors();

            Assert.Empty(result);
        }
        public void GetRides_TwoRides_ExpectTwoRides()
        {
            var tales = new List <RideDto>()
            {
                { new RideDto() }, { new RideDto() }
            };

            HttpClient httpClient = HttpClientMockHelper.GetMockedHttpClient(JsonConvert.SerializeObject(tales));
            var        rideClient = new RideClient(httpClient);

            var result = rideClient.GetRides();

            Assert.NotEmpty(result);
            Assert.Equal(2, result.Count);
        }
        public void GetStands_TwoStands_ExpectTwoStands()
        {
            var tales = new List <StandDto>()
            {
                { new StandDto() }, { new StandDto() }
            };

            HttpClient httpClient  = HttpClientMockHelper.GetMockedHttpClient(JsonConvert.SerializeObject(tales));
            var        standClient = new StandClient(httpClient);

            var result = standClient.GetStands();

            Assert.NotEmpty(result);
            Assert.Equal(2, result.Count);
        }
        public void GetVisitors_TwoVisitors_ExpectTwoVisitors()
        {
            var tales = new List <VisitorDto>()
            {
                { new VisitorDto() }, { new VisitorDto() }
            };

            HttpClient httpClient    = HttpClientMockHelper.GetMockedHttpClient(JsonConvert.SerializeObject(tales));
            var        visitorClient = new VisitorClient(httpClient);

            var result = visitorClient.GetVisitors();

            Assert.NotEmpty(result);
            Assert.Equal(2, result.Count);
        }
Beispiel #17
0
        public void GetEmployees_TwoEmployees_ExpectTwoEmployees()
        {
            var employees = new List <EmployeeDto>()
            {
                { new EmployeeDto() }, { new EmployeeDto() }
            };

            HttpClient httpClient     = HttpClientMockHelper.GetMockedHttpClient(JsonConvert.SerializeObject(employees));
            var        employeeClient = new EmployeeClient(httpClient);

            var result = employeeClient.GetEmployees();

            Assert.NotEmpty(result);
            Assert.Equal(2, result.Count);
        }