public void Constructor_Sets_Initial_Values()
        {
            SaleDeedRegistryContract saleDeedRegistry =
                new SaleDeedRegistryContract(mockContractState.Object, payee);

            this.mockContractState.Setup(s => s.Message.Sender).Returns(Address.Zero);
        }
        public void SaleDeed_Pay_Transfer_Fee()
        {
            var moq = new Mock <SmartContract>();

            SaleDeedRegistryContract saleDeedRegistry =
                new SaleDeedRegistryContract(mockContractState.Object, payee);

            Address address = "0x0000000000000000000000000000000000000002".HexToAddress();

            this.mockPersistentState.Setup(s => s.GetUInt32($"PropertyState[" + assetId + "]"))
            .Returns((uint)PropertyStateType.ReviewComplete);

            this.mockPersistentState.Setup(s => s.GetAddress("PayeeAddress"))
            .Returns(payee);

            mockInternalExecutor.Setup(s =>
                                       s.Call(
                                           It.IsAny <ISmartContractState>(),
                                           It.IsAny <Address>(),
                                           It.IsAny <ulong>(),
                                           "Transfer",
                                           It.IsAny <object[]>(),
                                           It.IsAny <ulong>()))
            .Returns(transferResult.Object);

            saleDeedRegistry.PayApplicationTransferFee(buyer, payee, assetId, 2000);

            this.mockPersistentState.Setup(s => s.GetUInt32($"PropertyState[" + assetId + "]"))
            .Returns((uint)PropertyStateType.PaidTransferFee);

            // Get the Property State and validate
            uint state = saleDeedRegistry.GetPropertyState(assetId);

            Assert.True(state == (uint)PropertyStateType.PaidTransferFee);
        }
        public void SaleDeed_Transfer_Ownership()
        {
            SaleDeedRegistryContract saleDeedRegistry =
                new SaleDeedRegistryContract(mockContractState.Object, payee);

            Address address = "0x0000000000000000000000000000000000000002".HexToAddress();

            this.mockPersistentState.Setup(s => s.GetUInt32($"PropertyState[" + assetId + "]"))
            .Returns((uint)PropertyStateType.PaidTransferFee);

            this.mockPersistentState.Setup(s => s.GetAddress($"PropertyOwner[" + assetId + "]"))
            .Returns(propertyOwner);

            this.mockPersistentState.Setup(s => s.GetBool($"EncumbranceCleared[" + assetId + "]"))
            .Returns(true);

            this.mockPersistentState.Setup(s => s.GetString($"AssetId[" + propertyOwner + "]"))
            .Returns(assetId);

            saleDeedRegistry.TransferOwnership(propertyOwner, buyer, assetId);

            this.mockPersistentState.Setup(s => s.GetUInt32($"PropertyState[" + assetId + "]"))
            .Returns((uint)PropertyStateType.Approved);

            // Get the Property State and validate
            uint state = saleDeedRegistry.GetPropertyState(assetId);

            Assert.True(state == (uint)PropertyStateType.Approved);
        }
        public void SaleDeed_ReApply_Application()
        {
            SaleDeedRegistryContract saleDeedRegistry =
                new SaleDeedRegistryContract(mockContractState.Object, payee);

            Address address = "0x0000000000000000000000000000000000000002".HexToAddress();

            this.mockPersistentState.Setup(s => s.GetUInt32($"PropertyState[" + assetId + "]"))
            .Returns((uint)PropertyStateType.InProgress);

            saleDeedRegistry.ReApply(assetId);

            // Get the Property State and validate
            uint state = saleDeedRegistry.GetPropertyState(assetId);

            Assert.True(state == (uint)PropertyStateType.InProgress);
        }
        public void SaleDeed_Start_Review_Process()
        {
            SaleDeedRegistryContract saleDeedRegistry =
                new SaleDeedRegistryContract(mockContractState.Object, payee);

            Address address = "0x0000000000000000000000000000000000000002".HexToAddress();

            this.mockPersistentState.Setup(s => s.GetUInt32($"PropertyState[" + assetId + "]"))
            .Returns((uint)PropertyStateType.InProgress);

            saleDeedRegistry.StartReviewProcess(propertyOwner, buyer, assetId);

            this.mockPersistentState.Setup(s => s.GetUInt32($"PropertyState[" + assetId + "]"))
            .Returns((uint)PropertyStateType.UnderReview);

            // Get the Property State and validate
            uint state = saleDeedRegistry.GetPropertyState(assetId);

            Assert.True(state == (uint)PropertyStateType.UnderReview);
        }