示例#1
0
        public void MustReturnDefaultWhenTypeDoesntExist()
        {
            var doesExistBefore = _sut.TryGet(out AnotherFakeContext newContext);

            Assert.False(doesExistBefore);
            Assert.Null(newContext);
            var c1New          = _sut.GetOrDefault <AnotherFakeContext>();
            var doesExistAfter = _sut.TryGet(out newContext);

            Assert.Equal(default, c1New);
示例#2
0
        public void MustReturnFalseAndDefaultOutParameterWhenFullQualifiedNamespaceOfTypeDoesntExist()
        {
            var c1Failure = _sut.TryGet <int>("not.a.real.namespace", out var c1);

            Assert.False(c1Failure);
            Assert.Equal(default, c1);