public void testGetFileFromSQLAndRemote() { Client.Client client = new Client.Client(); List<string> input = new List<string>(); input.Add("text"); List<String> files = client.getFromTag(input); client.connect(); client.login("Testuser", "Test"); //client.requestFile(files.First()); client.disconnect(); Assert.IsTrue(System.IO.File.Exists("C:\\Caesura\\" + files.First())); }
public void testNoFileFromSQL() { Client.Client client = new Client.Client(); List<string> input = new List<string>(); input.Add("nonTag"); List<String> files = client.getFromTag(input); client.connect(); client.login("Testuser", "Test"); Assert.IsTrue((files.Count < 1)); client.disconnect(); }
public void testGetFileFromSQLAndRemote() { Client.Client client = new Client.Client(); List <string> input = new List <string>(); input.Add("text"); List <String> files = client.getFromTag(input); client.connect(); client.login("Testuser", "Test"); //client.requestFile(files.First()); client.disconnect(); Assert.IsTrue(System.IO.File.Exists("C:\\Caesura\\" + files.First())); }
public void testGetBadFileFromRemote() { Client.Client client = new Client.Client(); client.connect(); client.login("Testuser", "Test"); try { //client.requestFile("failFile.txt"); } finally { client.disconnect(); } }
public void testGetBadFileFromRemote() { Client.Client client = new Client.Client(); client.connect(); client.login("Testuser", "Test"); try { //client.requestFile("failFile.txt"); } finally { client.disconnect(); } }
public void testNoFileFromSQL() { Client.Client client = new Client.Client(); List <string> input = new List <string>(); input.Add("nonTag"); List <String> files = client.getFromTag(input); client.connect(); client.login("Testuser", "Test"); Assert.IsTrue((files.Count < 1)); client.disconnect(); }
public bool getFile(string fileName) { if (currentUser != null) { //check permissions later if (File.Exists(fileName)) { client.connect(); bool returner = client.requestFile(fileName); client.disconnect(); return(returner); } return(false); } throw new InvalidOperationException("Not Logged In"); }
public void testLoginTransferHex() { client = new Client.Client(); client.connect(); if (System.IO.File.Exists("C:\\Caesura\\testpic.jpg")) { System.IO.File.Delete("C:\\Caesura\\testpic.jpg"); } Assert.IsFalse(System.IO.File.Exists("C:\\Caesura\\testpic.jpg")); Assert.True(client.login("Testuser", "Test")); //Assert.True(client.requestFile("testpic.jpg")); client.disconnect(); Assert.IsTrue(System.IO.File.Exists("C:\\Caesura\\testpic.jpg")); // Assert that the contents are correct Assert.AreEqual(System.IO.File.ReadAllBytes("testpic.jpg"), System.IO.File.ReadAllBytes("C:\\Caesura\\testpic.jpg")); }
public void testLoginTransferHex() { client = new Client.Client(); client.connect(); if (System.IO.File.Exists("C:\\Caesura\\testpic.jpg")) { System.IO.File.Delete("C:\\Caesura\\testpic.jpg"); } Assert.IsFalse(System.IO.File.Exists("C:\\Caesura\\testpic.jpg")); Assert.True(client.login("Testuser", "Test")); //Assert.True(client.requestFile("testpic.jpg")); client.disconnect(); Assert.IsTrue(System.IO.File.Exists("C:\\Caesura\\testpic.jpg")); // Assert that the contents are correct Assert.AreEqual(System.IO.File.ReadAllBytes("testpic.jpg"), System.IO.File.ReadAllBytes("C:\\Caesura\\testpic.jpg")); }