Skip to content

Commit

Permalink
feature: Added Coffee Drinks to Synthetic (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
RLittlesII authored Jul 3, 2020
1 parent ccd3c19 commit 7067d9b
Show file tree
Hide file tree
Showing 12 changed files with 257 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Data/Data/DataServiceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Reactive.Threading.Tasks;
using System.Threading;
using DynamicData;
using JetBrains.Annotations;

namespace Data
{
Expand All @@ -22,7 +23,7 @@ public abstract class DataServiceBase<T> : IDataService<T>
/// Initializes a new instance of the <see cref="DataServiceBase{T}"/> class.
/// </summary>
/// <param name="client">The abstracted client.</param>
protected DataServiceBase(IClient client)
protected DataServiceBase([NotNull] IClient client)
{
_client = client;
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
130 changes: 130 additions & 0 deletions src/Synthetic/Drinks/DrinkClientMock.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
using System.Collections.Generic;

namespace Rocket.Surgery.Airframe.Synthetic
{
/// <summary>
/// Represents an <see cref="IClient"/> that returns <see cref="DrinkDto"/>.
/// </summary>
public class DrinkClientMock : ClientMock<DrinkDto>
{
/// <summary>
/// Initializes a new instance of the <see cref="DrinkClientMock"/> class.
/// </summary>
public DrinkClientMock()
{
Items = new List<DrinkDto>
{
new DrinkDto
{
Title = "Americano",
Type = DrinkType.Americano,
Description = "Dark. Strong"
},
new DrinkDto
{
Title = "Blonde Americano",
Type = DrinkType.Americano,
Description = "Dark. Strong"
},
new DrinkDto
{
Title = "Blonde Roast",
Type = DrinkType.Brewed
},
new DrinkDto
{
Title = "Caffe Misto",
Type = DrinkType.Brewed
},
new DrinkDto
{
Title = "Dark Roast",
Type = DrinkType.Brewed
},
new DrinkDto
{
Title = "Medium Roast",
Type = DrinkType.Brewed
},
new DrinkDto
{
Title = "Espresso",
Type = DrinkType.Espresso,
Description = "Hot. Bold."
},
new DrinkDto
{
Title = "Cappuccino",
Type = DrinkType.Cappuccino,
Description = "Foamy. Light."
},
new DrinkDto
{
Title = "Blonde Cappuccino",
Type = DrinkType.Cappuccino,
Description = "Foamy. Light."
},
new DrinkDto
{
Title = "Flat White",
Type = DrinkType.FlatWhite,
Description = "Heavy. Full."
},
new DrinkDto
{
Title = "Blonde Flat White",
Type = DrinkType.FlatWhite,
Description = "Heavy. Full."
},
new DrinkDto
{
Title = "Caffe Latte",
Type = DrinkType.Latte,
Description = "Smooth. Bold."
},
new DrinkDto
{
Title = "Vanilla Latte",
Type = DrinkType.Latte,
Description = "Smooth. Bold."
},
new DrinkDto
{
Title = "Burnt Honey Latte",
Type = DrinkType.Latte,
Description = "Smooth. Bold."
},
new DrinkDto
{
Title = "Hazelnut Latte",
Type = DrinkType.Latte,
Description = "Smooth. Bold."
},
new DrinkDto
{
Title = "Macchiato",
Type = DrinkType.Macchiato,
Description = "Hot. Bold."
},
new DrinkDto
{
Title = "Carmel Macchiato",
Type = DrinkType.Macchiato,
Description = "Rich. Sweet."
},
new DrinkDto
{
Title = "Latte Macchiato",
Type = DrinkType.Macchiato,
Description = "Hot. Bold."
},
new DrinkDto
{
Title = "Hazelnut Macchiato",
Type = DrinkType.Macchiato,
Description = "Hot. Bold."
}
};
}
}
}
20 changes: 20 additions & 0 deletions src/Synthetic/Drinks/DrinkDataService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Data;
using JetBrains.Annotations;

namespace Rocket.Surgery.Airframe.Synthetic
{
/// <summary>
/// Represents a coffee data service.
/// </summary>
public class DrinkDataService : DataServiceBase<DrinkDto>, IDrinkService
{
/// <summary>
/// Initializes a new instance of the <see cref="DrinkDataService"/> class.
/// </summary>
/// <param name="client">The client.</param>
public DrinkDataService(IClient client)
: base(client)
{
}
}
}
35 changes: 35 additions & 0 deletions src/Synthetic/Drinks/DrinkDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using Data;

namespace Rocket.Surgery.Airframe.Synthetic
{
/// <summary>
/// A coffee drink data transfer object.
/// </summary>
public class DrinkDto : Dto
{
/// <summary>
/// Gets or sets the title.
/// </summary>
public string Title { get; set; }

/// <summary>
/// Gets or sets the description.
/// </summary>
public string Description { get; set; }

/// <summary>
/// Gets or sets the image.
/// </summary>
public string Image { get; set; }

/// <summary>
/// Gets or sets the price.
/// </summary>
public double Price { get; set; }

/// <summary>
/// Gets or sets the type.
/// </summary>
public DrinkType Type { get; set; }
}
}
43 changes: 43 additions & 0 deletions src/Synthetic/Drinks/DrinkType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
namespace Rocket.Surgery.Airframe.Synthetic
{
/// <summary>
/// Enumeration representing espresso drink types.
/// </summary>
public enum DrinkType
{
/// <summary>
/// Caffe Americano
/// </summary>
Americano,

/// <summary>
/// Drip Coffee
/// </summary>
Brewed,

/// <summary>
/// Cappuccino
/// </summary>
Cappuccino,

/// <summary>
/// Espresso Shots
/// </summary>
Espresso,

/// <summary>
/// Flat White
/// </summary>
FlatWhite,

/// <summary>
/// Caffe Latte
/// </summary>
Latte,

/// <summary>
/// Macchiato
/// </summary>
Macchiato
}
}
11 changes: 11 additions & 0 deletions src/Synthetic/Drinks/IDrinkService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Data;

namespace Rocket.Surgery.Airframe.Synthetic
{
/// <summary>
/// Interface representing a coffee drink data service.
/// </summary>
public interface IDrinkService : IDataService<DrinkDto>
{
}
}
14 changes: 14 additions & 0 deletions src/Synthetic/Synthetic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,18 @@
<ItemGroup>
<ProjectReference Include="..\Data\Data.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Coffee\CoffeeClientMock.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Coffee\CoffeeDataService.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Coffee\CoffeeDto.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Coffee\ICoffeeDataService.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions src/Synthetic/Synthetic.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=drinks/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

0 comments on commit 7067d9b

Please sign in to comment.