public void AssemblyToExchangeModel() { var baseAssembly = AssemblyModelDataProvider.AssemblyTestV4; var(assembly, dependencies) = baseAssembly.ToExchangeModel(); Assert.That.DeepEqual(AssemblyExchangeDataProvider.AssemblyTestV4(), assembly); Assert.AreEqual(0, dependencies.Count); }
public void ExchangeToAssemblyModel() { var assembly = AssemblyExchangeDataProvider.AssemblyTestV4(); var dependencies = Array.Empty <AssemblyExchange>(); var result = assembly.ToAssemblyModel(dependencies); Assert.That.DeepEqual(AssemblyModelDataProvider.AssemblyTestV4, result); }
public void ExchangeToAssemblyTwoSameVersion() { var assembly = AssemblyExchangeDataProvider.AnalyseBase(); var dependencies = new[] { AssemblyExchangeDataProvider.AssemblyTestV4(), AssemblyExchangeDataProvider.AssemblyTestV4(), }; assembly.AssembliesReferenced.AddRange(dependencies.Select(x => x.Name)); Assert.ThrowsException <ArgumentException>(() => assembly.ToAssemblyModel(dependencies)); }
public void ExchangeToAssemblyWithLink() { var assembly = AssemblyExchangeDataProvider.AnalyseBase(); var dependencies = new[] { AssemblyExchangeDataProvider.AssemblyTestV4(), }; assembly.AssembliesReferenced.AddRange(dependencies.Select(x => x.Name)); var result = assembly.ToAssemblyModel(dependencies); Assert.AreEqual(1, result.ReferencedAssemblyNames.Count); Assert.AreEqual(AssemblyExchangeDataProvider.AssemblyTestV4().Name, result.References[0].AssemblyFullName); Assert.AreEqual(AssemblyExchangeDataProvider.AssemblyTestV4().Version, result.References[0].AssemblyVersion); }
public void ExchangeToInformationMissingVersion() { var assembly = AssemblyExchangeDataProvider.AnalyseBase(); var dependencies = new[] { AssemblyExchangeDataProvider.AssemblyTestV4(), }; assembly.AssembliesReferenced.Add(AssemblyExchangeDataProvider.AssemblyTestV2().Name); var result = assembly.ToAssemblyModel(dependencies); Assert.AreEqual(AssemblyExchangeDataProvider.AssemblyTestV2().Name, result.References[0].AssemblyFullName); Assert.AreEqual(AssemblyExchangeDataProvider.AssemblyTestV2().Version, result.References[0].AssemblyVersion); Assert.AreEqual(AssemblyExchangeDataProvider.AssemblyTestV4().Version, result.References[0].LoadedAssembly.Version); Assert.AreEqual(AssemblyExchangeDataProvider.AssemblyTestV4().Name, result.References[0].LoadedAssembly.FullName); Assert.AreEqual(true, result.References[0].LoadedAssembly.IsResolved); }
public void ExchangeToAssemblyismatchAndTwoVesions() { var assembly = AssemblyExchangeDataProvider.AnalyseBase(); var dependencies = new[] { AssemblyExchangeDataProvider.AssemblyTestV4(), AssemblyExchangeDataProvider.AssemblyTestV2(), }; assembly.AssembliesReferenced.Add(AssemblyExchangeDataProvider.AssemblyTestV2().Name); var result = assembly.ToAssemblyModel(dependencies); Assert.AreEqual(AssemblyExchangeDataProvider.AssemblyTestV2().Name, result.References[0].AssemblyFullName); Assert.AreEqual(AssemblyExchangeDataProvider.AssemblyTestV2().Version, result.References[0].AssemblyVersion); Assert.AreEqual(AssemblyExchangeDataProvider.AssemblyTestV4().Version, result.References[0].LoadedAssembly.Version); Assert.AreEqual(AssemblyExchangeDataProvider.AssemblyTestV4().Name, result.References[0].LoadedAssembly.FullName); }