Пример #1
0
        private ServiceProxy CreateServiceProxy()
        {
            _serializer = MockRepository.GenerateStub<IXmlSerializer>();
            _serializer.Stub(s => s.Serialize<Request>(null)).IgnoreArguments().Return(String.Empty);
            _serializer.Stub(s => s.Deserialize<Response>(String.Empty)).IgnoreArguments().Return(null);

            _poster = MockRepository.GenerateStub<IWebPoster>();
            _poster.Stub(p => p.Post(String.Empty)).IgnoreArguments().Return(String.Empty);

            return new ServiceProxy(_serializer, _poster);
        }
Пример #2
0
        public void User_options_are_deserialised_if_the_file_exists()
        {
            const string projectLocation     = "test.gallio";
            var          userOptionsLocation = projectLocation + UserOptions.Extension;

            fileSystem.Stub(fs => fs.FileExists(Arg <string> .Is.Anything))
            .Return(true);
            xmlSerializer.Stub(xs => xs.LoadFromXml <UserOptions>(Arg <string> .Is.Anything))
            .Return(new UserOptions());

            controller.Handle(new ProjectLoaded(projectLocation));

            xmlSerializer.AssertWasCalled(xs => xs.LoadFromXml <UserOptions>(userOptionsLocation));
        }
Пример #3
0
 private void SetUpOptionsController(Settings settings)
 {
     fileSystem.Stub(fs => fs.FileExists(Arg <string> .Is.Anything)).Return(true);
     xmlSerializer.Stub(xs => xs.LoadFromXml <Settings>(Arg <string> .Is.Anything)).Return(settings);
     optionsController.Load();
 }