public OOBDataSourceTests() { using (ShimsContext.Create()) { fds = new fake.ShimDataSource(); fds.NameGet = () => { return("Friendly Situation - Friendly Equipment"); }; fds.IdGet = () => { return("b8725bd2-1aa2-4a06-895b-d87a8028d75a"); }; string currentPath = new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).DirectoryName; string dataPath = System.IO.Path.Combine(currentPath, @"..\..\resources\"); string dataFile = dataPath + "oobdatasources.txt"; System.Diagnostics.Trace.WriteLine("Test data file=" + dataFile); if (!File.Exists(dataFile)) { throw new Exception("Test data file not found: " + dataFile); } using (FileStream fs = File.OpenRead(dataFile)) { byte[] b = new byte[1024]; UTF8Encoding temp = new UTF8Encoding(true); while (fs.Read(b, 0, b.Length) > 0) { odsString += (temp.GetString(b)); } } serialized = odsString.Split(';')[1]; ods = OOBDataSource.marshalODS(fds, serialized); } }
public OOBDataSourceTests() { using (ShimsContext.Create()) { fds = new fake.ShimDataSource(); fds.NameGet = () => { return("Friendly Situation - Friendly Equipment"); }; fds.IdGet = () => { return("b8725bd2-1aa2-4a06-895b-d87a8028d75a"); }; using (FileStream fs = File.OpenRead("C:/Dev/VS/DefenseSolution/OrderOfBattle/OrderOfBattleUnitTests/resources/oobdatasources.txt")) { byte[] b = new byte[1024]; UTF8Encoding temp = new UTF8Encoding(true); while (fs.Read(b, 0, b.Length) > 0) { odsString += (temp.GetString(b)); } } serialized = odsString.Split(';')[1]; ods = OOBDataSource.marshalODS(fds, serialized); } }