public void ReturnKeyField_WhenKeyPropertyGetterIsInvoked()
        {
            string[] paths = new string[] { "/file1" };
            var resEnumerator = new ResourceEnumerator2(paths);

            var fieldValue = "Key1";
            FieldInfo keyField = resEnumerator.GetType().GetField("key", BindingFlags.Instance | BindingFlags.NonPublic);
            keyField.SetValue(resEnumerator, fieldValue);

            Assert.AreEqual(fieldValue, resEnumerator.Key);
        }
        public void ReturnDictionaryEntryWithCurrentKeyAndValue_WhenEntryPropertyGetterIsInvoked()
        {
            string[] paths = new string[] { "/file1" };
            var resEnumerator = new ResourceEnumerator2(paths);

            var keyFieldValue = "Key1";
            var valueFieldValue = "Value1";

            FieldInfo keyField = resEnumerator.GetType().GetField("key", BindingFlags.Instance | BindingFlags.NonPublic);
            keyField.SetValue(resEnumerator, keyFieldValue);

            FieldInfo valueField = resEnumerator.GetType().GetField("value", BindingFlags.Instance | BindingFlags.NonPublic);
            valueField.SetValue(resEnumerator, valueFieldValue);

            var entry = resEnumerator.Entry;
            Assert.AreEqual(entry.Key, keyFieldValue);
            Assert.AreEqual(entry.Value, valueFieldValue);
        }
        public void ReadTheEntriesFromTheResourceFile_WhenFileExist()
        {
            var resEnumerator = new ResourceEnumerator2(new string[] { "Page1.aspx.resx" });

            // make sure first entry exists
            Assert.IsTrue(resEnumerator.MoveNext());
            Assert.AreEqual("Label2.Text", resEnumerator.Entry.Key);
            Assert.AreEqual("Hello universe!", resEnumerator.Entry.Value);

            // make sure second entry exists
            Assert.IsTrue(resEnumerator.MoveNext());
            Assert.AreEqual("Literal1.Text", resEnumerator.Entry.Key);
            Assert.AreEqual("Hello world!", resEnumerator.Entry.Value);

            // make sure there is no thrid entry
            Assert.IsTrue(resEnumerator.MoveNext());
            Assert.AreEqual("Literal3.Text", resEnumerator.Entry.Key);
            Assert.AreEqual("1. Text!", resEnumerator.Entry.Value);

            Assert.IsFalse(resEnumerator.MoveNext());
        }