Skip to content

Commit 4b68e6d

Browse files
committed
Some clean up
1 parent dcbc4f9 commit 4b68e6d

4 files changed

Lines changed: 36 additions & 24 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
namespace Linq2GraphQL.Client
2+
{
3+
public class CustomScalar
4+
{
5+
internal string InternalValue { get; set; }
6+
7+
public override string ToString()
8+
{
9+
return base.ToString();
10+
}
11+
12+
public virtual string Value
13+
{
14+
get { return InternalValue; }
15+
16+
set { InternalValue = value; }
17+
18+
}
19+
}
20+
}

src/Linq2GraphQL.Client/Converters/CustomScalarConverter.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,7 @@
55

66
namespace Linq2GraphQL.Client
77
{
8-
public class CustomScalar
9-
{
10-
internal string InternalValue { get; set; }
11-
12-
13-
public virtual string Value
14-
{
15-
get { return InternalValue; }
16-
17-
set { InternalValue = value; }
18-
19-
}
20-
}
8+
219

2210

2311

test/Linq2GraphQL.TestClientNullable/ExtendedScalars/MacAddress.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,18 @@ public MacAddress(string value)
1818

1919
public override string Value
2020
{
21-
get {
22-
//Customer Code
23-
return base.Value; }
24-
set {
21+
get
22+
{
23+
//Custom Code
24+
25+
return base.Value;
26+
}
27+
set
28+
{
2529
//Custom code
26-
27-
base.Value = value; }
30+
31+
base.Value = value;
32+
}
2833
}
2934

3035

test/Linq2GraphQL.Tests/ScalarTests.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,22 @@ public async Task GetScalar()
2525
.Select()
2626
.ExecuteAsync();
2727

28-
var macAddress = result;
29-
30-
Assert.NotNull(macAddress);
28+
Assert.NotNull(result.MacAddress);
29+
Assert.NotNull(result.Longitude);
3130
}
3231

3332
[Fact]
3433
public async Task SetScalar()
3534
{
3635
var result = await sampleClient
3736
.Mutation
38-
.UpdatePerson(person: new PersonInput { Name = "Peter", MacAddress = new MacAddress("01-23-45-67-89-ab") })
37+
.UpdatePerson(person: new PersonInput { Name = "Peter", MacAddress = new MacAddress("01-23-45-67-89-ab"), Longitude = new Longitude { Value = "14° 24' 0\" E" } })
3938
.Select()
4039
.ExecuteAsync();
4140

4241

4342

44-
Assert.NotNull(result.MacAddress);
43+
Assert.NotNull(result);
4544
}
4645

4746

0 commit comments

Comments
 (0)