//[TestMethod, TestCategory("Integration")] //[DeploymentItem(@"testdata\LateboundConstantsGeneratorConfiguration.xml")] public void GenerateConstants_Should_GenerateConstantsFileClass() { // Arrange var lcgHelper = new LCGHelper(); lcgHelper.LoadSettingsFromFile("LateboundConstantsGeneratorConfiguration.xml"); var filename = $"constants_{Guid.NewGuid()}.cs"; var credentials = new CrmCredentials { Domain = "MyDomain", OrgUnit = "MyOrganizationUnit", ServerName = "MyServerName", Password = "******", Protocol = CrmCredentials.protocol.https, User = "******" }; lcgHelper.ConnectCrm(credentials); // Act lcgHelper.GenerateConstants(); // Assert Assert.IsTrue(File.Exists(Path.Combine(lcgHelper.Settings.OutputFolder, lcgHelper.Settings.CommonFile + ".cs"))); }
public void LoadSettingsFromFile_Should_LoadTestFileSettings() { // Arrange var lcgHelper = new LCGHelper(); // Act lcgHelper.LoadSettingsFromFile("LateboundConstantsGeneratorConfiguration.xml"); // Assert Assert.IsNotNull(lcgHelper.Settings); Assert.AreEqual("LateboundConstantGeneratorTests", lcgHelper.Settings.NameSpace); Assert.AreEqual(3, lcgHelper.Settings.Selection.Count); Assert.AreEqual("contact", lcgHelper.Settings.Selection[0].Split(':')[0]); }
//[TestMethod, TestCategory("Integration")] //[DeploymentItem(@"testdata\LateboundConstantsGeneratorConfiguration.xml")] public void GenerateConstants_usingConnectionString_Should_GenerateConstantsFileClass() { // Arrange var lcgHelper = new LCGHelper(); lcgHelper.LoadSettingsFromFile("LateboundConstantsGeneratorConfiguration.xml"); var filename = $"constants_{Guid.NewGuid()}.cs"; var connectionString = $"MyCrmConnectionString"; lcgHelper.ConnectCrm(connectionString); // Act lcgHelper.GenerateConstants(); // Assert Assert.IsTrue(File.Exists(Path.Combine(lcgHelper.Settings.OutputFolder, lcgHelper.Settings.CommonFile + ".cs"))); }