I would like to check that the string from a textbox is of format "dd-MMM-yyyy" e.g. 14-Mar-2023 I have written the following code but I get an error
string date = Page.HeaderDate().Text
date.Should().Be(string.Format("dd-MMM-yyyy")
Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: 'Expected date to be "dd-mmm-yyyy", but "14-Mar-2023" differs near "14-" (index 0).'
Any ideas,thoughts much appreciated.
Thanks