// Use this for initialization void Start() { ITestLogic lo = InvokeService.Proxy <ITestLogic>(); string res = lo.test(); print(res); //bool isAss = typeof(IHttpSync).IsAssignableFrom(typeof(ITesst)); //print(typeof(ITesst)); //print(typeof(IHttpSync)); //print(isAss); //ITesst socket = InvokeService.Proxy<ITesst>(); //socket.xxx(1, "a");、 // HttpWebRequest wbRequest = (HttpWebRequest)WebRequest.Create(""); //wbRequest.Method = "POST"; //wbRequest.ContentType = "application/octet-stream"; //using (Stream requestStream = wbRequest.GetRequestStream()) //{ // using (StreamWriter sw = new StreamWriter(requestStream)) // { // //sw.Write(null); // } //} //HttpWebResponse wbResponse = (HttpWebResponse)wbRequest.GetResponse(); //using (Stream responseStream = wbResponse.GetResponseStream()) //{ // using (StreamReader sread = new StreamReader(responseStream)) // { // result = sread.ReadToEnd(); // } //} }
public void TestLogicFactory_Can_CreateTestLogicInstance() { //Arrange //method args = string testType bool result = false; string sysrTestType = "Sysr"; string mapsTestType = "Maps"; TestLogicFactory target = new TestLogicFactory(); //Act ITestLogic testLogic1 = target.CreateTestLogicInstance(sysrTestType); ITestLogic testLogic2 = target.CreateTestLogicInstance(mapsTestType); if (testLogic1 is SysrTestLogic) { if (testLogic2 is MapsTestLogic) { result = true; } } //Assert Assert.IsTrue(result); }
public void Show(ITestLogic tl) { //TestLogic1 tl = new TestLogic1(); while (true) { // obtain one question at a time Question question = tl.NextQuestion(); // break the loop when no questions are left if (question == null) { break; } // display question to the user Console.WriteLine($"Q: {question.Statement}"); Console.WriteLine($"1: { question.Option1}"); Console.WriteLine($"2: { question.Option2}"); Console.WriteLine($"3: { question.Option3}"); Console.WriteLine($"4: { question.Option4}"); // Accept user's choice Console.Write("Select an Option: "); int choice = Convert.ToInt32(Console.ReadLine()); // Get user's choice compared to correct answer and get user's marks incremented tl.CheckAnswer(choice); } // Display result Console.WriteLine($"You obtained ${ tl.UserMarks} out of ${ tl.TotalMarks}"); }
public Question GetNextQuestion(Test test, Question prevQuestion, ITestLogic logic) { this.logic = logic; int qId = logic.GetQuestionId(test, prevQuestion, uow); Question q = uow.Questions.GetById(qId); return q; }
public Question GetNextQuestion(Test test, Question prevQuestion, ITestLogic logic) { this.logic = logic; int qId = logic.GetQuestionId(test, prevQuestion, uow); Question q = uow.Questions.GetById(qId); return(q); }
public void Setup() { _testRepoMock = new Mock <ITestRepository>(); _appSettingsMock = new Mock <IOptions <AppSettings> >(); _testLogic = new TestLogic(_testRepoMock.Object, _appSettingsMock.Object); _testRepoMock.Setup(tr => tr.getValueFromTheDatabase()).Returns(5); }
/// <summary></summary> public IntegrationApiController(IConfiguration configuration, ITestLogic testLogic) { _testLogic = testLogic; var platformSettings = configuration.GetSection("Platform").Get <PlatformSettings>(); var tokenRefresher = new TokenRefresher(configuration, platformSettings.ClientId, platformSettings.ClientSecret); _integrationApiClient = new IntegrationApiRestClient(new HttpSender(platformSettings.IntegrationApiUrl, tokenRefresher.GetServiceClient())); }
public BusinessApiTranslationsTestController(IConfiguration configuration, ITestLogic testLogic) : base(configuration, testLogic) { var platformSettings = configuration.GetSection("Platform").Get <PlatformSettings>(); var tokenRefresher1 = new TokenRefresher(configuration, configuration["Capability1:ClientId"], configuration["Capability1:ClientSecret"]); _bapiClientAsCapability1Client = new BusinessApiRestClient(new HttpSender(platformSettings.BusinessApiUrl, tokenRefresher1)); var tokenRefresher2 = new TokenRefresher(configuration, configuration["Capability2:ClientId"], configuration["Capability2:ClientSecret"]); _bapiClientAsCapability2Client = new BusinessApiRestClient(new HttpSender(platformSettings.BusinessApiUrl, tokenRefresher2)); }
public Question GetNextQuestion(Test test, Question prevQuestion) { if (test.Type != null) { //this.tLogic = logic; tLogic = this.factory.CreateTestLogicInstance(test.Type); int qId = tLogic.GetQuestionId(test, prevQuestion, uow); Question q = uow.Questions.GetById(qId); return(q); } return(null); }
public Question GetNextQuestion(Test test, Question prevQuestion) { if (test.Type != null) { //this.tLogic = logic; tLogic = this.factory.CreateTestLogicInstance(test.Type); int qId = tLogic.GetQuestionId(test, prevQuestion, uow); Question q = uow.Questions.GetById(qId); return q; } return null; }
public Capability1CallbackController(IConfiguration configuration, ITestLogic testLogic) : base(configuration, testLogic) { var nexusSettings = configuration.GetSection("Nexus").Get <NexusSettings>(); var platformSettings = configuration.GetSection("Platform").Get <PlatformSettings>(); // Note! Assumes same /Tokens endpoint in the Business API as in Nexus Fundamentals var authManager = new NexusAuthenticationManager(nexusSettings.Tenant, platformSettings.IntegrationApiUrl); var tokenRefresher = authManager.CreateTokenRefresher(new AuthenticationCredentials { ClientId = platformSettings.ClientId, ClientSecret = platformSettings.ClientSecret }); // Note! Assumes same /TestBench endpoint in the Business API as in Nexus Business Events _businessEventsClient = new BusinessEvents(platformSettings.IntegrationApiUrl, nexusSettings.Tenant, tokenRefresher.GetServiceClient()); }
public static void Main() { // Display UI //ConsoleUI cui = new ConsoleUI(); //cui.Show(); // GraphicalUI gui = new GraphicalUI(); // gui.Show(); ITestLogic tl = Factory.GetLogic(); IUI cui = Factory.GetUI(); cui.Show(tl); Console.ReadLine(); }
public ConsoleApplication(ITestLogic logic) { Logic = logic; }
public TestVm(ITestLogic logic) { _logic = logic; }
public TestController(ITestLogic logic) { Logic = logic; }
public void Show(ITestLogic t1) { this.tl = t1; // Display the GUI and Start the Event Loop ShowDialog(); }
public Capability1TestsController(IConfiguration configuration, ITestLogic testLogic) : base(configuration, testLogic) { var baseUri = $"{configuration["Capability1:BaseUrl"]}"; _restclient = new Capability1RestClient(new HttpSender(baseUri)); }
/// <summary></summary> protected TestControllerBase(IConfiguration configuration, ITestLogic testLogic) { Configuration = configuration; TestLogic = testLogic; }
public Capability2TestsController(IConfiguration configuration, ITestLogic testLogic) : base(configuration, testLogic) { }
public TestsController(IHubContext <TestsHub> hubContext, ITestLogic testLogic) { _hubContext = hubContext; _testLogic = testLogic; }
/// <summary></summary> public PurgeJob(ITestLogic testLogic, ILogger <PurgeJob> logger) { _testLogic = testLogic; _logger = logger; }
public TestController(ITestLogic testLogic) { _testLogic = testLogic; }
public SandboxController(ITestLogic testLogic) { this._testLogic = testLogic; }
/// <summary></summary> public AllTestsController(IConfiguration configuration, ITestLogic testLogic) : base(configuration, testLogic) { }
/// <summary></summary> public PlatformAuthenticationTestController(IConfiguration configuration, ITestLogic testLogic) : base(configuration, testLogic) { _platformSettings = configuration.GetSection("Platform").Get <PlatformSettings>(); _apiRestClient = new IntegrationApiRestClient(new HttpSender(_platformSettings.IntegrationApiUrl)); }
public TestsHub(ITestLogic testLogic) { _testLogic = testLogic; }
public QuestionGenerator(ITestLogic logic) { this.logic = logic; }