﻿using FluentAssertions;
using NUnit.Framework;
using Trinity.Core;
using Trinity.Extensions;

namespace Trinity.Unit.Tests
{
    public class UT_TransactionResult
    {
        private TransactionResult uut;

        [SetUp]
        public void TestSetup()
        {
            uut = new TransactionResult();
        }

        [Test]
        public void AssetId_Get()
        {
            uut.AssetId.Should().BeNull();
        }

        [Test]
        public void AssetId_Set()
        {
            var val = new UInt256(TestUtils.GetByteArray(32, 0x42));
            uut.AssetId = val;
            uut.AssetId.Should().Be(val);
        }

        [Test]
        public void Amount_Get()
        {
            uut.Amount.Should().Be(Fixed8.Zero);
        }

        [Test]
        public void Amount_Set()
        {
            var val = Fixed8.FromDecimal(42);
            uut.Amount = val;
            uut.Amount.Should().Be(val);
        }
    }
}