using NUnit.Framework;using VBASync.Model;namespace VBASync.Tests.IntegrationTests{[TestFixture]public class FixCaseTests{[Test]public void FixCaseBasic(){const string oldFile = @"VERSION 1.0 CLASSBEGINMultiUse = -1 'TrueENDAttribute VB_Name = ""ThisWorkbook""Attribute VB_Base = ""0{00020819-0000-0000-C000-000000000046}""Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = TrueAttribute VB_TemplateDerived = FalseAttribute VB_Customizable = TrueOption Explicit' hello world!Sub tes()Dim HelloWorld$HelloWorld = ""Hello, world!""MsgBox HelloWorldEnd SubSub tes2()MsgBox 2 + 2End SubSub tes3()MsgBox ""Hello, world!""End Sub";const string newFileRaw = @"VERSION 1.0 CLASSBEGINMultiUse = -1 'TrueENDAttribute VB_Name = ""ThisWorkbook""Attribute VB_Base = ""0{00020819-0000-0000-C000-000000000046}""Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = TrueAttribute VB_TemplateDerived = FalseAttribute VB_Customizable = TrueOption Explicit' Hello world!Sub Tes()Dim helloworld$helloworld = ""Hello, World!""MsgBox helloworldEnd SubSub Tes2()MsgBox 2 + 3End SubSub Tes3()MsgBox ""Hello, world!""End Sub";const string newFileFix = @"VERSION 1.0 CLASSBEGINMultiUse = -1 'TrueENDAttribute VB_Name = ""ThisWorkbook""Attribute VB_Base = ""0{00020819-0000-0000-C000-000000000046}""Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = TrueAttribute VB_TemplateDerived = FalseAttribute VB_Customizable = TrueOption Explicit' Hello world!Sub tes()Dim HelloWorld$helloworld = ""Hello, World!""MsgBox HelloWorldEnd SubSub tes2()MsgBox 2 + 3End SubSub tes3()MsgBox ""Hello, world!""End Sub";Assert.That(newFileFix, Is.EqualTo(ModuleProcessing.FixCase(oldFile, newFileRaw)));}[Test]public void FixCaseWasDuplicatingLines(){const string oldFile = @"Attribute VB_Name = ""Module1""Option ExplicitSub StubbedOuttes()MsgBox ""Hello, world!""End SubSub StubbedOuttes2()MsgBox ""Hello, world!""End Sub";const string newFile = @"Attribute VB_Name = ""Module1""Option ExplicitSub tes()MsgBox ""Hello, world!""End SubSub tes2()MsgBox ""Hello, world!""End Sub";Assert.That(newFile, Is.EqualTo(ModuleProcessing.FixCase(oldFile, newFile)));}}}