Наследование: IRecordedHttpOutput
Пример #1
0
        public void replay_writes_to_the_IHttpWriter()
        {
            var header = new Header(HttpResponseHeader.Warning, "don't do it!");

            var writer = MockRepository.GenerateMock<IHttpWriter>();

            header.Replay(writer);

            writer.AssertWasCalled(x => x.AppendHeader("Warning", "don't do it!"));
        }
Пример #2
0
        public void register_saves_a_copy_of_the_enumerable_and_not_the_same()
        {
            var headers = new Header[] { new Header("a", "1"), new Header("b", "2"), new Header("c", "3") };

            var hash = Guid.NewGuid().ToString();

            var cache = new HeadersCache();
            cache.Register(hash, headers);

            cache.Current(hash).ShouldNotBeTheSameAs(headers);
        }
Пример #3
0
        public void register_and_fetch()
        {
            var headers = new Header[]{new Header("a", "1"), new Header("b", "2"), new Header("c", "3")};

            var hash = Guid.NewGuid().ToString();

            var cache = new HeadersCache();
            cache.Register(hash, headers);
        
            cache.Current(hash).ShouldHaveTheSameElementsAs(headers);
        }
Пример #4
0
        public void eject_clears_it_out()
        {
            var headers = new Header[] { new Header("a", "1"), new Header("b", "2"), new Header("c", "3") };

            var hash = Guid.NewGuid().ToString();

            var cache = new HeadersCache();
            cache.Register(hash, headers);

            cache.Eject(hash);

            cache.Current(hash).Any().ShouldBeFalse();
        }
Пример #5
0
 public bool Equals(Header other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.Name, Name) && Equals(other.Value, Value);
 }
Пример #6
0
 public void AppendHeader(string header, string value)
 {
     output = new Header(header, value);
 }