Exemplo n.º 1
0
        public void Test_casing(string regex, string method, bool expectedResult)
        {
            IFileSystem fileSystemSub = Substitute.For <IFileSystem>();

            fileSystemSub.File.Exists(FilePath).Returns(true);
            fileSystemSub.File.ReadLines(FilePath).Returns(new[] { regex });

            RpcMethodFilter filter = new RpcMethodFilter(FilePath, fileSystemSub, LimboLogs.Instance.GetClassLogger());

            filter.AcceptMethod(method).Should().Be(expectedResult);
        }
Exemplo n.º 2
0
        public void Test_multiple_lines()
        {
            IFileSystem fileSystemSub = Substitute.For <IFileSystem>();

            fileSystemSub.File.Exists(FilePath).Returns(true);
            fileSystemSub.File.ReadLines(FilePath).Returns(new[] { "eth*", "debug*" });

            RpcMethodFilter filter = new RpcMethodFilter(FilePath, fileSystemSub, LimboLogs.Instance.GetClassLogger());

            filter.AcceptMethod("eth_blockNumber").Should().BeTrue();
            filter.AcceptMethod("debug_trace").Should().BeTrue();
        }