Exemple #1
0
        public void TryGet()
        {
            var mbdb = new MockBaseDatabase();

            mbdb.TryGet("a", out var result)
            .Should()
            .BeTrue();

            result
            .Should()
            .Be(0);

            mbdb.TryGet("d", out result)
            .Should()
            .BeTrue();

            result
            .Should()
            .Be(3);

            mbdb.TryGet("e", out result)
            .Should()
            .BeFalse();

            result
            .Should()
            .Be(default);
Exemple #2
0
        public void Get()
        {
            var mbdb = new MockBaseDatabase();

            mbdb.Get("a")
            .Should()
            .Be(0);

            mbdb.Get("d")
            .Should()
            .Be(3);

            Action throws = () => mbdb.Get("e");

            throws
            .Should()
            .ThrowExactly <KeyNotFoundException>();
        }