Example #1
0
        public void BuildSignature_WhenCalled_ShouldStartWithRfc2822Date()
        {
            //arrange
            var sut = new SignatureConstructor();

            //act
            var actual = sut.BuildSignature(url, now);

            //assert
            actual.Should(Be.StringStarting("Thu, 01 Jan 2015 12:00:00+0000"));
        }
Example #2
0
        public void ToRfc2822_WhenDateIsProvided_ShouldStartWithWeekDayInCultureInvariant()
        {
            //arrange
            var sut = new DateTime(2015, 1, 1, 12, 0, 0);

            //act
            var actual = sut.ToRfc2822Date();

            //assert
            actual.Should(Be.StringStarting("Thu"));
        }
Example #3
0
        public void BuildSignature_WhenCalled_ShouldHaveTwoCarriageReturnsAfterTheRfc2822Date()
        {
            //arrange
            var sut = new SignatureConstructor();

            //act
            var actual = sut.BuildSignature(url, now);


            //assert
            var subString = actual.Substring(now.ToRfc2822Date(timeZoneInfo).Length);

            subString.Should(Be.StringStarting("\n\n"));
        }
Example #4
0
 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"));
 }