public void ToRfc2822_WhenDateIsProvidedWithTimeZoneWithOffSet_ShouldEndUpWithProvidedTimeZoneInfoUtcOffset() { //arrange var sut = new DateTime(2015, 1, 1, 12, 0, 0); //act var actual = sut.ToRfc2822Date(TimeZoneInfo.CreateCustomTimeZone("Time+0200", new TimeSpan(2, 0, 0), "Time+0200", "Time+0200")); //assert actual.Should(Be.StringEnding("+0200")); }
public void BuildSignature_WhenCalled_ShouldEndWithApplicationType() { //arrange var sut = new SignatureConstructor(); //act var actual = sut.BuildSignature(url, now); //assert actual.Should(Be.StringEnding("application/json; version=1")); }
public void ToRfc2822_WhenNoTimeZoneSpecified_ShouldEndUpWithLocalUtcOffset() { //arrange var sut = new DateTime(2015, 1, 1, 12, 0, 0); //act var actual = sut.ToRfc2822Date(TimeZoneInfo.Local); var hours = Math.Abs(TimeZoneInfo.Local.BaseUtcOffset.Hours).ToString("00"); var minutes = Math.Abs(TimeZoneInfo.Local.BaseUtcOffset.Minutes).ToString("00"); //assert actual.Should(Be.StringEnding("+" + hours + minutes)); }
public void Libraries() { fluent.Libraries.Count.ShouldEqual(1); fluent.Libraries.First().Should(Be.StringEnding("/FluentNHibernate.dll")); nunit.Libraries.Count.ShouldEqual(3); nunit.Libraries.AsFiles().Select(f => f.Name()).ToList().ShouldEqual(new List <string> { "nunit.framework.dll", "nunit.mocks.dll", "pnunit.framework.dll" }); foo.Libraries.AsFiles().Select(f => f.Name()).ToList().ShouldEqual(new List <string> { "Another.Global.DLL", "global_1.dll", "fooooo.dll", "Hi.DlL", "TherE.dLl" }); }
public void Read() { tool.Read("just-a-tool.nuspec").Should(Be.StringStarting("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<package>\n <metadata>")); tool.Read("just-a-tool.nuspec").Should(Be.StringEnding(" </metadata>\n</package>\n")); }