Esempio n. 1
0
        public DataSourceElementTests()
        {
            var testDataSourceTypeName = string.Format("{0}, {1}", typeof(TestDataSource).FullName,
                                                       typeof(TestDataSource).Assembly.GetName().Name);

            var dataSourceMock = new Mock <Scarf.Configuration.DataSourceElement>();

            dataSourceMock.SetupGet(ds => ds.Type).Returns(testDataSourceTypeName);

            _scarfSectionMock = ConfigurationMocks.CreateNewScarfSectionMock();
            _scarfSectionMock.SetupGet(s => s.DataSource).Returns(dataSourceMock.Object);

            ScarfConfiguration.ConfigurationSection = _scarfSectionMock.Object;
        }
        public static void InitClass(TestContext context)
        {
            dataSource = new TestDataSource();
            ScarfConfiguration.DataSourceFactory = new TestDataSourceFactory(dataSource);

            var scarfSectionMock = ConfigurationMocks.CreateNewScarfSectionMock();

            debugElementMock  = new Mock <DebugElement>();
            auditElementMock  = new Mock <AuditElement>();
            accessElementMock = new Mock <AccessElement>();
            actionElementMock = new Mock <ActionElement>();

            scarfSectionMock.SetupGet(s => s.Access).Returns(accessElementMock.Object);
            scarfSectionMock.SetupGet(s => s.Action).Returns(actionElementMock.Object);
            scarfSectionMock.SetupGet(s => s.Audit).Returns(auditElementMock.Object);
            scarfSectionMock.SetupGet(s => s.Debug).Returns(debugElementMock.Object);

            ScarfConfiguration.ConfigurationSection = scarfSectionMock.Object;
        }