Esempio n. 1
0
    public void All_Values_Are_Copied_To_Tenant(TenantDTO dto, byte[] versionBytes)
    {
        //Version needs to be a valid base 64 string
        dto.Version = Convert.ToBase64String(versionBytes);
        Tenant tenant = dto.ToTenant();

        AssertAdditions.AllPropertiesAreEqual(tenant, dto, nameof(tenant.ConcurrencyToken), nameof(tenant.CreatedTime));
    }
Esempio n. 2
0
    public void Over_Rides_Correct_Values_On_Copy(Tenant fromDb, TenantDTO fromUser)
    {
        fromUser.Id      = fromDb.Id;
        fromUser.Version = fromUser.Version != null?Convert.ToBase64String(Encoding.UTF8.GetBytes(fromUser.Version)) : null;

        Assert.NotEqual(fromDb.Name, fromUser.Name);

        fromUser.CopyTo(fromDb);

        AssertAdditions.AllPropertiesAreEqual(fromDb, fromUser, nameof(fromDb.ConcurrencyToken), nameof(fromDb.CreatedTime));
    }
Esempio n. 3
0
    public void All_Values_Are_Copied_To_DTO(Tenant tenant)
    {
        TenantDTO dto = new TenantDTO(tenant);

        AssertAdditions.AllPropertiesAreEqual(dto, tenant, nameof(dto.Version), nameof(dto.CreatedTime));
        Assert.NotNull(tenant.CreatedTime);

        if (tenant.CreatedTime != null)
        {
            Assert.Equal(tenant.CreatedTime.Value, dto.CreatedTime);
        }
    }
Esempio n. 4
0
        public void All_Values_Are_Copied_To_Tenant(NewTenantRequest tenantRequest)
        {
            Tenant tenant = tenantRequest.ToTenant();

            AssertAdditions.AllPropertiesAreEqual(tenant, tenantRequest, nameof(tenant.ConcurrencyToken), nameof(tenant.CreatedTime), nameof(tenant.Id));
        }