public void testIfLaunchRequestCreateProperLaunchObjectInList() { apiResponse = File.ReadAllText("ApiTypicalResponse.txt"); if (apiResponse == null) { throw new AssertFailedException(); } var parser = new APIParser(); var launchList = parser.parseLaunchRequest(apiResponse); Launch launch = new Launch(); launch.name = "Vostok-K | Sputnik 10"; launch.status = "Success"; launch.windowStart = DateTime.ParseExact("1961-03-25T05:54:00Z", "yyyy-MM-ddTHH:mm:ssZ", System.Globalization.CultureInfo.InvariantCulture); launch.windowEnd = DateTime.ParseExact("1961-03-25T05:54:00Z", "yyyy-MM-ddTHH:mm:ssZ", System.Globalization.CultureInfo.InvariantCulture); launch.launchProvider = "Strategic Missile Troops"; launch.rocketFullName = "Vostok-K"; launch.location = "Baikonur Cosmodrome, Republic of Kazakhstan"; launch.locationGoogleMapsUrl = "https://www.google.com/maps/place/45°55'12.0\"N+63°20'31.2\"E"; Assert.IsTrue(launchList.Contains(launch)); }
public void testIfThrowsExceptionIfResponseHaveInproperFormat(string invalid) { var parser = new APIParser(); parser.parseLaunchRequest(invalid); }