Exemplo n.º 1
0
        public void PageLoad_WhenCalled_CreatesSqlCommands()
        {
            // Arrange
            const int    totalCommandsCount    = 10;
            const string expectedCommandText01 = "CREATE DATABASE Database";
            const string expectedCommandText02 = "create user [ApplicationUserName] from login [ApplicationUserName]";
            const string expectedCommandText03 = "sp_addrolemember";
            const string expectedCommandText04 = "INSERT INTO VERSIONS (VERSION, DTINSTALLED) VALUES (@version, GETDATE())";

            SetupForPageLoad();
            var adoShims = AdoShims.ShimAdoNetCalls();

            // Act
            _testEntityPrivate.Invoke(MethodPageLoad, this, EventArgs.Empty);

            // Assert
            adoShims.ShouldSatisfyAllConditions(
                () => adoShims.CommandsCreated.Count.ShouldBe(totalCommandsCount),
                () => adoShims.CommandsCreated.ShouldContain(item => item.CommandText == expectedCommandText01),
                () => adoShims.CommandsCreated.ShouldContain(item => item.CommandText == expectedCommandText02),
                () => adoShims.CommandsCreated.ShouldContain(item => item.CommandText == expectedCommandText03 &&
                                                             item.CommandType == CommandType.StoredProcedure),
                () => adoShims.CommandsCreated.ShouldContain(item => item.CommandText == expectedCommandText04),
                () => adoShims.CommandsCreated.ShouldContain(item => item.CommandText == Resources._0Tables01),
                () => adoShims.CommandsCreated.ShouldContain(item => item.CommandText == Resources._0Tables02),
                () => adoShims.CommandsCreated.ShouldContain(item => item.CommandText == Resources._1Views01),
                () => adoShims.CommandsCreated.ShouldContain(item => item.CommandText == Resources._2SPs01),
                () => adoShims.CommandsCreated.ShouldContain(item => item.CommandText == Resources._9Data01),
                () => adoShims.CommandsCreated.ShouldContain(item => item.CommandText == Resources._9Data02),
                () => adoShims.CommandsExecuted.Count.ShouldBe(totalCommandsCount),
                () => adoShims.CommandsDisposed.Count.ShouldBe(totalCommandsCount));
        }
Exemplo n.º 2
0
 public void Setup()
 {
     _shimsContext  = ShimsContext.Create();
     _eAction       = new eaction();
     _privateObject = new PrivateObject(_eAction);
     _adoShims      = AdoShims.ShimAdoNetCalls();
 }
Exemplo n.º 3
0
 public void TestInitialize()
 {
     _testEntity        = new ProjectWorkspaceSynch();
     _testEntityPrivate = new PrivateObject(_testEntity);
     _shimsContext      = ShimsContext.Create();
     _adoShims          = AdoShims.ShimAdoNetCalls();
     SetupDefaultShims();
 }
 public void TestInitialize()
 {
     _shimsContext      = ShimsContext.Create();
     _testEntity        = new SQL();
     _testEntityPrivate = new PrivateObject(_testEntity);
     _adoShims          = AdoShims.ShimAdoNetCalls();
     _logger            = new IntegrationLog(null, Guid.Empty, Guid.Empty, string.Empty);
 }
 public void Setup()
 {
     _context           = ShimsContext.Create();
     _adoShims          = AdoShims.ShimAdoNetCalls();
     _goToControl       = new GoToControl();
     _privateObject     = new PrivateObject(_goToControl);
     _pagePrivateObject = new PrivateObject(_goToControl, new PrivateType(typeof(Page)));
 }
        public void Initialize()
        {
            _shimsContext = ShimsContext.Create();

            _sharepointShims = SharepointShims.ShimSharepointCalls();
            _adoShims        = AdoShims.ShimAdoNetCalls();
            _privateType     = new PrivateType(typeof(ReportingData));
        }
Exemplo n.º 7
0
        public void TestInitialize()
        {
            _shimsContext      = ShimsContext.Create();
            _testEntity        = new runenterprisesynch();
            _testEntityPrivate = new PrivateObject(_testEntity);
            _adoShims          = AdoShims.ShimAdoNetCalls();

            ShimCoreFunctions.getConnectionStringGuid = _ => DummyConnectionString;
        }
 public void TestInitialize()
 {
     _testEntity            = new ProcessSecurity();
     _testEntityPrivate     = new PrivateObject(_testEntity);
     _testEntityPrivateType = new PrivateType(typeof(ProcessSecurity));
     _shimsContext          = ShimsContext.Create();
     _adoShims = AdoShims.ShimAdoNetCalls();
     _spShims  = SharepointShims.ShimSharepointCalls();
 }
Exemplo n.º 9
0
 public void SetUp()
 {
     _shimsContext       = ShimsContext.Create();
     _buttonClick1Method = typeof(pspubsettings).GetMethod("Button1_Click", BindingFlags.Instance | BindingFlags.NonPublic);
     _pspubsettings      = new pspubsettings();
     _args            = new EventArgs();
     _adoShims        = AdoShims.ShimAdoNetCalls();
     _sharepointShims = SharepointShims.ShimSharepointCalls();
 }
Exemplo n.º 10
0
 public void SetUp()
 {
     _shimsContext    = ShimsContext.Create();
     _pageLoadMethod  = typeof(epubstatus).GetMethod("Page_Load", BindingFlags.Instance | BindingFlags.NonPublic);
     _epubstatus      = new epubstatus();
     _args            = new EventArgs();
     _adoShims        = AdoShims.ShimAdoNetCalls();
     _sharepointShims = SharepointShims.ShimSharepointCalls();
 }
Exemplo n.º 11
0
        public void Setup()
        {
            _context         = ShimsContext.Create();
            _adoShims        = AdoShims.ShimAdoNetCalls();
            _sharepointShims = SharepointShims.ShimSharepointCalls();

            _adminQueue    = new adminqueue();
            _privateObject = new PrivateObject(_adminQueue);
        }
 public void SetUp()
 {
     _shimsContext    = ShimsContext.Create();
     _pageLoadMethod  = typeof(pspubsettings).GetMethod("Page_Load", BindingFlags.Instance | BindingFlags.NonPublic);
     _pspubsettings   = new pspubsettings();
     _args            = new EventArgs();
     _adoShims        = AdoShims.ShimAdoNetCalls();
     _sharepointShims = SharepointShims.ShimSharepointCalls();
     _getInt32Called  = false;
 }
Exemplo n.º 13
0
        public void TestInitialize()
        {
            _shimContext         = ShimsContext.Create();
            _shimSharepointCalls = SharepointShims.ShimSharepointCalls();
            _adoShims            = AdoShims.ShimAdoNetCalls();

            _privateObject = new PrivateObject(typeof(getts));

            ArrangeShims();
        }
Exemplo n.º 14
0
        public void SetUp()
        {
            _shimsContext = ShimsContext.Create();
            InitializeSharePoint();

            _testEntity        = new econfig();
            _testEntityPrivate = new PrivateObject(_testEntity);
            _adoShims          = AdoShims.ShimAdoNetCalls();

            InitializeUiControls();
        }
Exemplo n.º 15
0
        public void SetUp()
        {
            _shimsContext    = ShimsContext.Create();
            _adoShims        = AdoShims.ShimAdoNetCalls();
            _sharepointShims = SharepointShims.ShimSharepointCalls();

            _htmlWriterShims            = HtmlTextWriterShims.ShimHtmlTextWriterCalls();
            _listDisplaySettingIterator = new ListDisplaySettingIterator();
            _privateObject = new PrivateObject(_listDisplaySettingIterator);

            ArrangeShims();
        }
        public void SetUp()
        {
            _shimsContext = ShimsContext.Create();

            _adoShims        = AdoShims.ShimAdoNetCalls();
            _sharepointShims = SharepointShims.ShimSharepointCalls();

            _testObj    = new MyWorkReportData(new Guid(), ReportData, Server, false, Username, Password);
            _privateObj = new PrivateObject(_testObj);

            ShimSPList.AllInstances.ParentWebGet = _ => new ShimSPWeb();
            ShimSPWeb.AllInstances.SiteGet       = _ => new ShimSPSite();
            ShimDateTime.NowGet = () => DefaultDate;
        }
Exemplo n.º 17
0
        public void TestInitialize()
        {
            _shimsObject = ShimsContext.Create();
            SharepointShims.ShimSharepointCalls();
            _shimAdo = AdoShims.ShimAdoNetCalls();

            ArrangeShims();

            _applicationInstaller = new ApplicationInstaller(
                string.Empty,
                new ShimSqlConnection().Instance,
                new ShimInstallAndConfigure().Instance);

            _privateObject = new PrivateObject(_applicationInstaller);
        }
Exemplo n.º 18
0
        public void SetUp()
        {
            _shimsContext      = ShimsContext.Create();
            _adoShims          = AdoShims.ShimAdoNetCalls();
            _sharepointShims   = SharepointShims.ShimSharepointCalls();
            _ioShims           = IOShims.ShimIOCalls();
            _cryptographyShims = CryptographyShims.ShimCryptographyCalls();

            _timerJobBuild = Guid.NewGuid();
            _defaultStatus = 1;

            _spQuery           = string.Empty;
            _filterFieldName   = string.Empty;
            _useWbs            = string.Empty;
            _listTitlePattern  = string.Empty;
            _groupByFieldNames = new List <string>();
        }
Exemplo n.º 19
0
        public void SetUp()
        {
            _shimsContext    = ShimsContext.Create();
            _adoShims        = AdoShims.ShimAdoNetCalls();
            _sharepointShims = SharepointShims.ShimSharepointCalls();

            _testObj    = new adminconns();
            _privateObj = new PrivateObject(_testObj);

            ShimCoreFunctions.getConnectionStringGuid = (guid) => TestConnectionString;

            var webApp          = new ShimSPWebApplication();
            var persistedObject = new ShimSPPersistedObject(webApp);

            persistedObject.IdGet = () => Guid.Parse(WebAppId);
            _webAppSelector       = new StubWebApplicationSelector
            {
                GetItem01 = () => webApp
            };
        }
Exemplo n.º 20
0
        public void PageLoad_WhenCalled_CreatesSqlConnections()
        {
            // Arrange
            const int    totalConnectionsCount      = 2;
            const string expectedConnectionString01 = "Server=Server;Database=master;User Id=Username;Password=Password";
            const string expectedConnectionString02 = "Server=Server;Database=Database;User Id=Username;Password=Password";

            SetupForPageLoad();
            var adoShims = AdoShims.ShimAdoNetCalls();

            // Act
            _testEntityPrivate.Invoke(MethodPageLoad, this, EventArgs.Empty);

            // Assert
            adoShims.ShouldSatisfyAllConditions(
                () => adoShims.ConnectionsCreated.Count.ShouldBe(totalConnectionsCount),
                () => adoShims.ConnectionsCreated.ShouldContain(item => item.ConnectionString == expectedConnectionString01),
                () => adoShims.ConnectionsCreated.ShouldContain(item => item.ConnectionString == expectedConnectionString02),
                () => adoShims.ConnectionsOpened.Count.ShouldBe(totalConnectionsCount),
                () => adoShims.ConnectionsDisposed.Count.ShouldBe(totalConnectionsCount));
        }
Exemplo n.º 21
0
 public void Initialize()
 {
     _shims           = ShimsContext.Create();
     _adoShims        = AdoShims.ShimAdoNetCalls();
     _sharepointShims = SharepointShims.ShimSharepointCalls();
 }