public void TestAllConstructs() { string csharpConstructs = TestFilesHelper.GetFile("AllConstructs.cs"); Microsoft.CodeAnalysis.SyntaxNode vbActualConstructs = Converter.Convert(SyntaxFactory.ParseSyntaxTree(csharpConstructs)); string vbActual = vbActualConstructs.ToFullString(); string vbExpected = TestFilesHelper.GetFile("AllConstructs.txt"); Assert.Equal(vbExpected, vbActual); }
public async Task SubmitInvalidImage() { string ownerId = Constants.OwnerId; var testFileName = "valid_id.png"; byte[] doc = TestFilesHelper.GetTestFile(testFileName); bool isAsync = false; bool isMinimum = true; var response = await clientInstance.ValidateShelvesCompliace(ownerId, doc, isAsync, isMinimum); IsResultTypeValid(response); Assert.IsFalse(response.IsConfidenceAcceptable, $"Classification threshold failed. {response.DetectionNotes}"); }
public void TestCanExecuteProgramAndUploadSingleFile_withPrivateKeyAuthentication() { // arrange string pathOfTestFile = Path.GetTempFileName(); string pathOfPrivateKeyFile = Path.Combine(TestFilesHelper.GetTestFileDir(), "privateKeyOpenSSH.key"); string commandlineArgs = $@"--tt=upload --host={connectivitySettings.Host} -username={connectivitySettings.UserName} -pk={pathOfPrivateKeyFile} -password={connectivitySettings.Password} -sp={pathOfTestFile} -dp=/home/user/foo/bar -ow -vt"; string[] commandlineArgsAsArray = commandlineArgs.Split(' '); // act/assert -- 'assert' as in 'doesn't throw an error'. Program.Main(commandlineArgsAsArray); }
public async Task SubmitInvalidId() { string ownerId = Constants.OwnerId; string expectedValue = null; string testFileName = "invalid1.jpg"; byte[] doc = TestFilesHelper.GetTestFile(testFileName); bool isAsync = false; bool isMinimum = true; var response = await clientInstance.IDAuth(ownerId, doc, isAsync, isMinimum); IsResultTypeValid(response); Assert.IsFalse(response.IsAuthenticationSuccessful, "Authentication successful"); Assert.AreEqual(response.EmployeeName, expectedValue, $"expected result ({expectedValue}) matched"); }
public async Task SubmiteValidIncorrectFace() { string ownerId = Constants.OwnerId; string expectedValue = null; string testFileName = "invalid_id.png"; byte[] doc = TestFilesHelper.GetTestFile(testFileName); bool isAsync = false; bool isMinimum = true; var response = await clientInstance.FaceAuth(ownerId, doc, isAsync, isMinimum); IsResultTypeValid(response); Assert.IsFalse(response.IsAuthenticationSuccessful, "Authentication unsuccessful"); Assert.IsTrue(string.IsNullOrEmpty(response.DetectedFaceName), $"expected result ({expectedValue}) matched"); }
public async Task SubmitValidCorrectFace() { string ownerId = Constants.OwnerId; string expectedValue = "Mohamed Saif"; string testFileName = "valid_id.png"; byte[] doc = TestFilesHelper.GetTestFile(testFileName); bool isAsync = false; bool isMinimum = true; var response = await clientInstance.FaceAuth(ownerId, doc, isAsync, isMinimum); IsResultTypeValid(response); Assert.IsTrue(response.IsAuthenticationSuccessful, "Authentication successful"); Assert.AreEqual(response.DetectedFaceName, expectedValue, $"expected result ({expectedValue}) matched"); }