예제 #1
0
        public void AbsInstallerServiceConstructorTest()
        {
            // Arrange
            MockRepository mocks = new MockRepository();
            AbsInstallerService target;

            using (mocks.Record()) { /*nothing to record */  }

            using (mocks.Playback())
            {
                target = new AbsInstallerService(null);
            }
            Assert.IsNotNull(target);
        }
예제 #2
0
        public void GetInstallStatusTestWithBdVersionEqual()
        {
            // Arrange
            MockRepository mocks = new MockRepository();
            ISymNetInfo symNetInfo = mocks.StrictMock<ISymNetInfo>();
            ISymNetSettingContainer settingContainer = mocks.StrictMock<ISymNetSettingContainer>();
            AbsInstallerService target = new AbsInstallerService(settingContainer);
            InstallStatus expected = InstallStatus.UpToDate;
            InstallStatus actual;

            using (mocks.Record())
            {
                Expect.Call(settingContainer.CurrentVersionFromDB).Return(new Version(1, 0, 2, 0));
                Expect.Call(symNetInfo.Version).Return(new Version(1, 0, 2, 0));
            }

            using (mocks.Playback())
            {
                actual = target.GetInstallStatus(symNetInfo);
            }
            Assert.AreEqual(expected, actual);
        }
예제 #3
0
        public void GetInstallStatusTestWithNullSymNetInfo()
        {
            // Arrange
            MockRepository mocks = new MockRepository();
            ISymNetInfo symNetInfo = null;

            AbsInstallerService target = new AbsInstallerService(null);
            InstallStatus expected = InstallStatus.Unknown;
            InstallStatus actual;

            using (mocks.Record()) { /*nothing to record */  }

            using (mocks.Playback())
            {
                actual = target.GetInstallStatus(symNetInfo);
            }
            Assert.AreEqual(expected, actual);
        }