Skip to content

Commit

Permalink
remove some redundant private sets (#266)
Browse files Browse the repository at this point in the history
Co-authored-by: Oskar Dudycz <oskar.dudycz@gmail.com>
  • Loading branch information
SimonCropp and oskardudycz committed May 19, 2024
1 parent 36adfe2 commit feaa237
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Carts.Tests.Stubs.Repositories;

public class FakeRepository<T>: IMartenRepository<T> where T : class, IAggregate
{
public Dictionary<Guid, T> Aggregates { get; private set; }
public Dictionary<Guid, T> Aggregates { get; }

public FakeRepository(params (Guid,T)[] aggregates)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class OrderDetails

public Guid? PaymentId { get; private set; }

public List<EventsWrapper> Events { get; private set; } = [];
public List<EventsWrapper> Events { get; } = [];

public DateTimeOffset InitiatedAt { get; private set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Carts.Tests.Stubs.Repositories;

public class FakeRepository<T> : IEventStoreDBRepository<T> where T : class, IAggregate
{
public Dictionary<Guid, T> Aggregates { get; private set; }
public Dictionary<Guid, T> Aggregates { get; }

public FakeRepository(params (Guid, T)[] aggregates)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace SlimDownYourAggregate.Initial;
public class ChemicalReaction
{
public Guid Id { get; private set; }
public List<ReactionParticipant> Participants { get; private set; }
public List<ReactionParticipant> Participants { get; }
public ReactionState State { get; private set; }

public ChemicalReaction(Guid id, List<ReactionParticipant> participants)
Expand Down Expand Up @@ -60,7 +60,7 @@ public class ReactionParticipant(Guid id, string chemicalName, double moles, Par
public Guid Id { get; private set; } = id;
public string ChemicalName { get; private set; } = chemicalName;
public double Moles { get; private set; } = moles;
public ParticipantType Type { get; private set; } = type;
public ParticipantType Type { get; } = type;

public void UpdateMoles(double newMoles)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public record Completed: ChemicalReaction;
public class ReactionParticipant(double moles, ParticipantType type)
{
public double Moles { get; private set; } = moles;
public ParticipantType Type { get; private set; } = type;
public ParticipantType Type { get; } = type;

public void UpdateMoles(double newMoles)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Tickets.Tests.Stubs.Storage;

public class FakeRepository<T> : IMartenRepository<T> where T : class, IAggregate
{
public Dictionary<Guid, T> Aggregates { get; private set; }
public Dictionary<Guid, T> Aggregates { get; }

public FakeRepository(params (Guid, T)[] aggregates)
{
Expand Down

0 comments on commit feaa237

Please sign in to comment.