Esempio n. 1
0
        public void GetValue_Success()
        {
            var subject       = new TestDataPackage();
            var expectedKey   = "TestKey";
            var expectedValue = "My value";

            subject[expectedKey] = expectedValue;
            var result = subject.TestGetValue <string>(expectedKey);

            Assert.Equal(expectedValue, result);
        }
Esempio n. 2
0
        public void GetValue_PrimitiveNotFound_Default()
        {
            var subject = new TestDataPackage();
            var result  = subject.TestGetValue <int>("notfound");

            Assert.Equal(default, result);
Esempio n. 3
0
        public void GetValue_ThrowsWhenPropertyNull()
        {
            var subject = new TestDataPackage();

            Assert.Throws <ArgumentNullException>(() => subject.TestGetValue <string>(null));
        }