public async Task TestReturnPath(int val1, int val2, string returnPath)
        {
            var workspace = new IntegerWorkspace();

            var result = await workspace.Compare(val1, val2);

            Assert.Equal(returnPath, result);
        }
        public async Task TestOutputs(int val1, int val2, int sum)
        {
            var workspace = new IntegerWorkspace();

            var result = await workspace.Add(val1, val2);

            Assert.Equal(sum, result);
        }
        public void LoadErrorFree(string resourceName)
        {
            string processJson = ReadJsonResource(resourceName);
            var    workspace   = new IntegerWorkspace();
            var    success     = workspace.LoadUserProcesses(processJson, true, out List <string> errors);

            Assert.Null(errors);
            Assert.True(success);
        }
Ejemplo n.º 4
0
        public void SavedWorkspaceValidates()
        {
            var workspaceJson = new IntegerWorkspace().GetWorkspaceJson();

            Assert.NotNull(workspaceJson);

            var validationResult = Schemas.Validate(Schemas.Workspace, workspaceJson);

            Assert.True(validationResult.IsValid);
        }
Ejemplo n.º 5
0
        public async Task RunProcess(string resourceName, int inValue, int expectedResult)
        {
            string processJson = ProcessLoadingTests.ReadJsonResource(resourceName);
            var    workspace   = new IntegerWorkspace();
            var    success     = workspace.LoadUserProcesses(processJson, false, out _);

            Assert.True(success);

            var result = await workspace.ModifyNumber(inValue);

            Assert.Equal(expectedResult, result);
        }