Exemplo n.º 1
0
        public void SetUpFixture()
        {
            ILanguageWrapper mockLanguageWrapperEnglish = MockRepository.GenerateMock <ILanguageWrapper>();

            mockLanguageWrapperEnglish.Stub(x => x.ToString()).Return("en");

            _testItemKey1 = new ItemKey(_guid1, _path1, _ver1, mockLanguageWrapperEnglish, _webDbName);
            _testItemKey2 = new ItemKey(_guid2, _path1, _ver1, mockLanguageWrapperEnglish, _webDbName);
            _testItemKey3 = new ItemKey(_guid3, _path1, _ver1, mockLanguageWrapperEnglish, _webDbName);
            _testItemKey4 = new ItemKey(_guid4, _path1, _ver1, mockLanguageWrapperEnglish, _webDbName);
        }
Exemplo n.º 2
0
        public void SetUpFixture()
        {
            _mockLanguageWrapperEnglish = MockRepository.GenerateMock <ILanguageWrapper>();
            _mockLanguageWrapperEnglish.Stub(x => x.ToString()).Return(_langEnglish);

            _mockLanguageWrapperEnglishDuplicate = MockRepository.GenerateMock <ILanguageWrapper>();
            _mockLanguageWrapperEnglishDuplicate.Stub(x => x.ToString()).Return(_langEnglishDuplicate);

            _mockLanguageWrapperSpanish = MockRepository.GenerateMock <ILanguageWrapper>();
            _mockLanguageWrapperSpanish.Stub(x => x.ToString()).Return(_langSpanish);
        }
Exemplo n.º 3
0
        public void Language_MatchesConstructedValue()
        {
            //Arrange
            ItemKey testItemKey = new ItemKey(_guid1, _path1, _ver1, _mockLanguageWrapperEnglish, _masterDbName);

            //Act
            ILanguageWrapper testLanguageWrapper = testItemKey.Language;

            //Assert
            Assert.AreEqual(_mockLanguageWrapperEnglish.ToString(), testLanguageWrapper.ToString());
        }
Exemplo n.º 4
0
//		public void Initialize(Item item)
//		{
//			Initialize(item.ID, item.Paths.FullPath, item.Version, (LanguageWrapper)item.Language, item.Database.Name);
//		}

        private void Initialize(ID guid, string path, Version version, ILanguageWrapper language, string databaseName)
        {
            if (guid == (ID)null || path == null || version == null || language == null || databaseName == null)
            {
                throw new ArgumentNullException();
            }
            if (path == string.Empty || databaseName == string.Empty)
            {
                throw new ArgumentException();
            }
            _guid         = guid;
            _path         = path;
            _version      = version;
            _language     = language;
            _databaseName = databaseName;
        }
Exemplo n.º 5
0
        public void SetUpFixture()
        {
            ILanguageWrapper mockLanguageWrapperEnglish = MockRepository.GenerateMock <ILanguageWrapper>();
            ILanguageWrapper mockLanguageWrapperSpanish = MockRepository.GenerateMock <ILanguageWrapper>();

            mockLanguageWrapperEnglish.Stub(x => x.ToString()).Return("en");
            mockLanguageWrapperSpanish.Stub(x => x.ToString()).Return("es");

            Language foo = null;

            _testItemKey1           = new ItemKey(_guid1, _path1, _ver1, mockLanguageWrapperEnglish, _webDbName);
            _testItemKey1Duplicate1 = new ItemKey(_guid1, _path1, _ver1, mockLanguageWrapperEnglish, _webDbName);
            _testItemKey1Duplicate2 = new ItemKey(_guid1, _path1, _ver1, mockLanguageWrapperEnglish, _webDbName);
            _testItemKey2           = new ItemKey(_guid2, _path1, _ver1, mockLanguageWrapperEnglish, _webDbName);
            _testItemKey3           = new ItemKey(_guid3, _path1, _ver1, mockLanguageWrapperEnglish, _webDbName);
            _testItemKey4           = new ItemKey(_guid4, _path1, _ver1, mockLanguageWrapperEnglish, _webDbName);

            //_testSourceDictionary = new PackageSourceDictionary();// This is in the test setup instead of fixture setup so each test gets a clean start.
        }
Exemplo n.º 6
0
 public ItemKey(ID guid, string path, Version version, ILanguageWrapper language, string databaseName)
 {
     this.Initialize(guid, path, version, language, databaseName);
 }