public void ProcessSrcFile_EmptyString_NotPresentInOutput() { var contents = @" somevar.Text = ''; ".Replace("'", "\""); var expected = @"msgid '' msgstr '' 'Project-Id-Version: Testing\n' 'POT-Creation-Date: .* 'PO-Revision-Date: \n' 'Last-Translator: \n' 'Language-Team: \n' 'Plural-Forms: \n' 'MIME-Version: 1.0\n' 'Content-Type: text/plain; charset=UTF-8\n' 'Content-Transfer-Encoding: 8bit\n' # Project-Id-Version: Testing # Report-Msgid-Bugs-To: [email protected] # POT-Creation-Date: .* # Content-Type: text/plain; charset=UTF-8 ".Replace("'", "\""); using (var e = new EnvironmentForTest()) { Assert.That(e.MakePotFile(contents), Is.MultilineString(expected)); } }
public void ProcessSrcFile_AllMatches_OutputsGoodPo() { var contents = @" somevar.Text = 'FirstLocalizableString'; somevar.MyLocalizableFunction(StringCatalog.Get('SecondLocalizableString', 'SecondNotes')); somevar.MyLocalizableFunction('~ThirdLocalizableString', 'ThirdNotes'); ".Replace("'", "\""); var expected = @"msgid '' msgstr '' 'Project-Id-Version: Testing\n' 'POT-Creation-Date: .* 'PO-Revision-Date: \n' 'Last-Translator: \n' 'Language-Team: \n' 'Plural-Forms: \n' 'MIME-Version: 1.0\n' 'Content-Type: text/plain; charset=UTF-8\n' 'Content-Transfer-Encoding: 8bit\n' # Project-Id-Version: Testing # Report-Msgid-Bugs-To: [email protected] # POT-Creation-Date: .* # Content-Type: text/plain; charset=UTF-8 #: .* msgid 'FirstLocalizableString' msgstr '' #: .* #. SecondNotes msgid 'SecondLocalizableString' msgstr '' #: .* #. ThirdNotes msgid 'ThirdLocalizableString' msgstr '' ".Replace("'", "\""); using (var e = new EnvironmentForTest()) { Assert.That(e.MakePotFile(contents), Is.MultilineString(expected)); } }
public void Usage() { Assert.That(() => Assert.That("one\ntwo", Is.MultilineString("one\ntwo")), Throws.Nothing); }