Пример #1
0
        public void SqlServerProj_UpdateDacVersion_UsingFileList()
        {
            // Create a temp file and write some dummy attribute to it
            var      fileName = System.IO.Path.GetTempPath() + System.IO.Path.GetRandomFileName() + ".sqlproj";
            FileInfo f        = new FileInfo(fileName);

            File.WriteAllText(f.FullName, this.ProjectFileContents);

            var target = new DacVersion();

            var parameters = new Dictionary <string, object>
            {
                { "Files", new[] { f.FullName } },
                { "Version", "1.0.156.3" }
            };

            var invoker = new WorkflowInvoker(target);

            // act
            invoker.Invoke(parameters);

            // assert
            var text = File.ReadAllText(f.FullName);

            Assert.AreNotEqual(-1, text.IndexOf(string.Format("<DacVersion>1.0.156.3</DacVersion>", DateTime.Today), StringComparison.Ordinal));
        }
Пример #2
0
        public void SqlServerProj_UpdatesDacVersion_WhenExecuteInvoked()
        {
            // Create a temp file and write some dummy attribute to it
            var      fileName = System.IO.Path.GetTempPath() + System.IO.Path.GetRandomFileName() + ".sqlproj";
            FileInfo f        = new FileInfo(fileName);

            File.WriteAllText(f.FullName, this.ProjectFileContents);

            var target = new DacVersion {
                SqlProjFilePath = f.FullName, Version = "1.0.156.3"
            };
            var invoker = new WorkflowInvoker(target);

            // act
            invoker.Invoke();

            // assert
            var text = File.ReadAllText(f.FullName);

            Assert.AreNotEqual(-1, text.IndexOf(string.Format("<DacVersion>1.0.156.3</DacVersion>", DateTime.Today), StringComparison.Ordinal));
        }