Beispiel #1
0
        public void HookupMlString()
        {
            MockData1 data1 = new MockData1(m_wsFrn, m_wsEng);

            data1.MlSimpleOne.VernacularDefaultWritingSystem = m_tsf.MakeString("foo", m_wsFrn);

            MockParaBox mockPara = new MockParaBox();
            MlsHookup   mlHook   = new MlsHookup(data1, data1.MlSimpleOne, m_wsFrn, MockData1Props.MlSimpleOne(data1), mockPara);

            mlHook.ClientRunIndex = 7;

            data1.MlSimpleOne.SetVernacularDefaultWritingSystem("bar");

            data1.RaiseMlSimpleOneChanged(m_wsFrn);
            Assert.AreEqual(7, mockPara.TheIndex, "Should have fired the event and passed the string index");
            Assert.AreEqual("bar", mockPara.TheMlString.get_String(((MultiAccessor)data1.MlSimpleOne).VernWs).Text, "Should have informed para of new string");

            mockPara.TheTsString = m_tsf.MakeString("foo", m_wsFrn);

            data1.MlSimpleOne.SetAnalysisDefaultWritingSystem("eng");

            data1.RaiseMlSimpleOneChanged(m_wsEng);
            Assert.AreEqual("foo", mockPara.TheTsString.Text, "Should not have informed para of new string, since we are monitoring French and mocking English event");
            mlHook.Dispose();
        }
Beispiel #2
0
        public void HookupTsString()
        {
            MockData1 data1 = new MockData1(m_wsFrn, m_wsEng);

            data1.SimpleTwo = m_tsf.MakeString("foo", m_wsFrn);

            MockParaBox mockPara = new MockParaBox();
            var         mlHook   = new TssHookup(MockData1Props.SimpleTwo(data1), mockPara);

            mlHook.ClientRunIndex = 5;

            data1.SimpleTwo = m_tsf.MakeString("bar", m_wsFrn);

            data1.RaiseSimpleTwoChanged();
            Assert.AreEqual(5, mockPara.TheIndex, "Should have fired the event and notified the correct index");
            Assert.AreEqual("bar", mockPara.TheTsString.Text, "Should have informed para of new string");

            mlHook.Dispose();
        }