public static void Initialize(TestContext testContext) { dllPath = "./../../../DllForTests/TPA.ApplicationArchitecture.dll"; pathTarget = "./../../../UnitTestXmlSerializing/bin/Debug/xmlTest.xml"; serializer = new XMLSerializer(); assemblyMetadataBase = new AssemblyMetadataXml(); reflector = new Reflector(dllPath); serializer.Serialize(AssemblyMetadataMapper.MapToSerialize(reflector.AssemblyMetadata, assemblyMetadataBase.GetType()), pathTarget); assemblyMetadata = AssemblyMetadataMapper.MapToDeserialize(serializer.Deserialize(pathTarget)); }
public static void Initialize(TestContext testContext) { string _DBRelativePath = @"DatabaseForTests\TestDatabase.mdf"; string _TestingWorkingFolder = Environment.CurrentDirectory; string _DBPath = Path.Combine(_TestingWorkingFolder, _DBRelativePath); FileInfo _databaseFile = new FileInfo(_DBPath); Assert.IsTrue(_databaseFile.Exists, $"{Environment.CurrentDirectory}"); databasePath = $@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename={_DBPath};Integrated Security = True; Connect Timeout = 30;"; dllPath = "./../../../DllForTests/TPA.ApplicationArchitecture.dll"; serializer = new DatabaseSerializer(); assemblyMetadataBase = new AssemblyMetadataDB(); reflector = new Reflector(dllPath); serializer.Serialize(AssemblyMetadataMapper.MapToSerialize(reflector.AssemblyMetadata, assemblyMetadataBase.GetType()), databasePath); assemblyMetadata = AssemblyMetadataMapper.MapToDeserialize(serializer.Deserialize(databasePath)); }