public void SetUp()
 {
     _guidFactory = MockRepository.GenerateMock<IGuidFactory>();
     _guidFactory.Stub(arg => arg.Random()).Return(Guid.Parse("78d15a5e-723b-4b2f-974e-58f6852b6584")).Repeat.Once();
     _guidFactory.Stub(arg => arg.Random()).Return(Guid.Parse("e16a5bdb-bc1b-4364-a03c-1d1cffaa1b13")).Repeat.Once();
     _mapper = new RandomIdMapper(_guidFactory);
 }
示例#2
0
            public void Must_set_cookie_value_to_new_session_id_using_guidfactory()
            {
                Guid sessionId = Guid.Parse("7c5ec674-f3cb-442a-a72e-877bdb66f777");

                _guidFactory.Stub(arg => arg.Random()).Return(sessionId);
                _manager.ConfigureCookieAsync(_request, _response);

                Assert.That(_response.Cookies["name"].Value, Is.EqualTo(sessionId.ToString("N")));
            }
示例#3
0
 public void SetUp()
 {
     _name = "name";
     _id = Guid.Parse("2fa8d2d3-94ca-4c43-8dd0-50717c165c1f");
     _guidFactory = MockRepository.GenerateMock<IGuidFactory>();
     _guidFactory.Stub(arg => arg.Random()).Return(_id);
     _resolvedRelativeUrl = "resolved";
     _route = new Route.Routing.Route(_name, _guidFactory, _resolvedRelativeUrl);
 }
示例#4
0
            public void Must_use_random_guid_as_class_name()
            {
                _guidFactory.Stub(arg => arg.Random()).Return(Guid.Parse("a6ddb300-25e2-4c03-9aad-179bd4641f29"));

                Assert.That(_builder.BuildFromRandomGuid(), Is.EqualTo("_a6ddb30025e24c039aad179bd4641f29"));
            }