Beispiel #1
0
        public IHttpActionResult CreateFee(FeeDs feeDs)
        {
            var isupdate = _feeRepository.CreateFee(feeDs);

            if (isupdate == true)
            {
                return(Ok(isupdate));
            }
            return(BadRequest());
        }
Beispiel #2
0
        public void CreateFeeWrongTo()
        {
            var client = GetMockClient("");

            var repo  = new FeeRepository(client.Object);
            var feeId = Guid.NewGuid().ToString();

            Assert.Throws <ValidationException>(() => repo.CreateFee(new Fee
            {
                Id      = feeId,
                Amount  = 1000,
                Name    = "Test fee #1",
                FeeType = FeeType.Fixed,
                Cap     = "1",
                Max     = "3",
                Min     = "2",
            }));
        }
        public void CreateFeeWrongTo()
        {
            var client = GetMockClient("");

            var repo  = new FeeRepository(client.Object);
            var feeId = Guid.NewGuid().ToString();

            Assert.Throws <ValidationException>(() => repo.CreateFee(new Dictionary <string, object>
            {
                { "id", feeId },
                { "amount", "1000" },
                { "name", "Test fee #1" },
                { "fee_type_id", "1" },
                { "cap", "1" },
                { "max", "3" },
                { "min", "2" },
                { "to", "" }
            }));
        }
        public void CreateFeeSuccessfully()
        {
            var content = File.ReadAllText("../../../Fixtures/fees_create.json");
            var client  = GetMockClient(content);

            var repo       = new FeeRepository(client.Object);
            var feeId      = Guid.NewGuid().ToString();
            var createdFee = repo.CreateFee(new Dictionary <string, object>
            {
                { "id", feeId },
                { "amount", "1000" },
                { "name", "Test fee #1" },
                { "fee_type_id", "1" },
                { "cap", "1" },
                { "max", "3" },
                { "min", "2" },
                { "to", "buyer" }
            });

            Assert.IsNotNull(createdFee);
        }
Beispiel #5
0
        public void CreateFeeSuccessfully()
        {
            var content = File.ReadAllText("../../Fixtures/fees_create.json");
            var client  = GetMockClient(content);

            var repo       = new FeeRepository(client.Object);
            var feeId      = Guid.NewGuid().ToString();
            var createdFee = repo.CreateFee(new Fee
            {
                Id      = feeId,
                Amount  = 1000,
                Name    = "Test fee #1",
                FeeType = FeeType.Fixed,
                Cap     = "1",
                Max     = "3",
                Min     = "2",
                To      = "buyer"
            });

            Assert.IsNotNull(createdFee);
        }