Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 4ea28a2

Browse files
committed
Rename types
1 parent c4264c3 commit 4ea28a2

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

DocSourcing.Tests/DocSourcing.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
</Reference>
6060
</ItemGroup>
6161
<ItemGroup>
62-
<Compile Include="FooDocTests.cs" />
62+
<Compile Include="FooTests.cs" />
6363
<Compile Include="Properties\AssemblyInfo.cs" />
6464
</ItemGroup>
6565
<ItemGroup>

DocSourcing.Tests/FooDocTests.cs renamed to DocSourcing.Tests/FooTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@
88
using SqlStreamStore;
99
using Xunit;
1010

11-
public class FooDocTests : IDisposable
11+
public class FooTests : IDisposable
1212
{
1313
private readonly InMemoryStreamStore _streamStore;
14-
private readonly FooDocRepository _repository;
14+
private readonly FooRepository _repository;
1515

16-
public FooDocTests()
16+
public FooTests()
1717
{
1818
_streamStore = new InMemoryStreamStore();
1919
var serializerSettings = new JsonSerializerSettings();
20-
_repository = new FooDocRepository(_streamStore, serializerSettings);
20+
_repository = new FooRepository(_streamStore, serializerSettings);
2121
}
2222

2323
[Fact]
2424
public async Task Can_save_and_retrieve_doc()
2525
{
2626
const string id = "id-1";
27-
var doc = new FooDoc(id);
27+
var doc = new Foo(id);
2828
doc.Add(2);
2929
int balance = doc.Balance;
3030

@@ -39,7 +39,7 @@ public async Task Can_save_and_retrieve_doc()
3939
public async Task Can_update_doc()
4040
{
4141
const string id = "id-1";
42-
var doc = new FooDoc(id);
42+
var doc = new Foo(id);
4343
doc.Add(2);
4444
await _repository.Save(doc);
4545

DocSourcing/DocSourcing.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
<Reference Include="Microsoft.CSharp" />
4444
</ItemGroup>
4545
<ItemGroup>
46-
<Compile Include="FooDoc.cs" />
47-
<Compile Include="FooDocState.cs" />
48-
<Compile Include="FooDocRepository.cs" />
46+
<Compile Include="Foo.cs" />
47+
<Compile Include="FooMemento.cs" />
48+
<Compile Include="FooRepository.cs" />
4949
<Compile Include="Properties\AssemblyInfo.cs" />
5050
</ItemGroup>
5151
<ItemGroup>

DocSourcing/FooDoc.cs renamed to DocSourcing/Foo.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
namespace DocSourcing
22
{
3-
public class FooDoc
3+
public class Foo
44
{
5-
public FooDoc(string id)
5+
public Foo(string id)
66
{
77
Id = id;
88
}
99

10-
public FooDoc(string id, FooDocState state, int originalVersion)
10+
public Foo(string id, FooMemento state, int originalVersion)
1111
{
1212
Id = id;
1313
Balance = state.Balance;
@@ -25,9 +25,9 @@ public void Add(int i)
2525
Balance = Balance + i;
2626
}
2727

28-
internal FooDocState GetState()
28+
internal FooMemento GetState()
2929
{
30-
return new FooDocState
30+
return new FooMemento
3131
{
3232
Balance = Balance
3333
};

DocSourcing/FooDocState.cs renamed to DocSourcing/FooMemento.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace DocSourcing
22
{
3-
public class FooDocState
3+
public class FooMemento
44
{
55
public int Balance { get; set; }
66
}

DocSourcing/FooDocRepository.cs renamed to DocSourcing/FooRepository.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
using SqlStreamStore;
99
using SqlStreamStore.Streams;
1010

11-
public class FooDocRepository
11+
public class FooRepository
1212
{
1313
private readonly JsonSerializerSettings _serializerSettings;
1414
private readonly int _maxCount;
1515
private readonly IStreamStore _streamStore;
1616

17-
public FooDocRepository(
17+
public FooRepository(
1818
IStreamStore streamStore,
1919
JsonSerializerSettings serializerSettings,
2020
int maxCount = 10)
@@ -24,7 +24,7 @@ public FooDocRepository(
2424
_maxCount = maxCount;
2525
}
2626

27-
public async Task<FooDoc> Load(
27+
public async Task<Foo> Load(
2828
string id,
2929
CancellationToken cancellationToken = default(CancellationToken))
3030
{
@@ -35,12 +35,12 @@ public async Task<FooDoc> Load(
3535
}
3636
var streamMessage = page.Messages.First();
3737
var jsonData = await streamMessage.GetJsonData(cancellationToken);
38-
var state = JsonConvert.DeserializeObject<FooDocState>(jsonData, _serializerSettings);
39-
return new FooDoc(id, state, page.LastStreamVersion);
38+
var state = JsonConvert.DeserializeObject<FooMemento>(jsonData, _serializerSettings);
39+
return new Foo(id, state, page.LastStreamVersion);
4040
}
4141

4242
public async Task Save(
43-
FooDoc streamDocument,
43+
Foo streamDocument,
4444
CancellationToken cancellationToken = default(CancellationToken))
4545
{
4646
var state = streamDocument.GetState();

0 commit comments

Comments
 (0)