Esempio n. 1
0
        public void Mappings_Can_Be_Injected_instead_of_explicitly_coded_in_the_context()
        {
            //Arrange
            _mockMapping.Expect(x => x.ConfigureModelBuilder(Arg <DbModelBuilder> .Is.Anything));

            //Act
            try
            {
                target.Set <Foo>().ToList();
            }
            catch (Exception)
            {
                //Suppress the error from the context. This allows us to test the mappings peice without having to actually map.
            }


            //Assert
            _mockMapping.VerifyAllExpectations();
        }
        public void Setup()
        {
            fooMapping = MockRepository.GenerateMock <IMappingConfiguration>();
            fooMapping.Expect(
                m =>
                m.ConfigureModelBuilder(Arg <DbModelBuilder> .Is.Anything)).Repeat.Once();

            barMapping = MockRepository.GenerateMock <IMappingConfiguration>();
            barMapping.Expect(
                m =>
                m.ConfigureModelBuilder(Arg <DbModelBuilder> .Is.Anything)).Repeat.Once();

            bazMapping = MockRepository.GenerateMock <IMappingConfiguration>();
            bazMapping.Expect(
                m =>
                m.ConfigureModelBuilder(Arg <DbModelBuilder> .Is.Anything)).Repeat.Once();

            quxMapping = MockRepository.GenerateMock <IMappingConfiguration>();
            quxMapping.Expect(
                m =>
                m.ConfigureModelBuilder(Arg <DbModelBuilder> .Is.Anything)).Repeat.Once();
        }
        public void Setup()
        {
            fooMapping = MockRepository.GenerateMock<IMappingConfiguration>();
            fooMapping.Expect(
                m =>
                m.ConfigureModelBuilder(Arg<DbModelBuilder>.Is.Anything)).Repeat.Once();
            
            barMapping = MockRepository.GenerateMock<IMappingConfiguration>();
            barMapping.Expect(
                m =>
                m.ConfigureModelBuilder(Arg<DbModelBuilder>.Is.Anything)).Repeat.Once();

            bazMapping = MockRepository.GenerateMock<IMappingConfiguration>();
            bazMapping.Expect(
                m =>
                m.ConfigureModelBuilder(Arg<DbModelBuilder>.Is.Anything)).Repeat.Once();

            quxMapping = MockRepository.GenerateMock<IMappingConfiguration>();
            quxMapping.Expect(
                m =>
                m.ConfigureModelBuilder(Arg<DbModelBuilder>.Is.Anything)).Repeat.Once();


        }