Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Builder for Snapshot #141

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

PascalSenn
Copy link
Member

Add Builder for Snapshots

@sonarcloud
Copy link

sonarcloud bot commented Oct 13, 2021

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@nscheibe nscheibe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should do a small refactoring and write also some tests for it. especially naming etc.

/// <summary>
/// Initializes a builder to configure the snapshot
/// </summary>
/// <param name="target"></param>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

params not commented :)

/// Initializes a builder to configure the snapshot
/// </summary>
/// <param name="target"></param>
/// <returns></returns>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returns not commented :)

/// <summary>
/// Initializes a builder to configure the snapshot
/// </summary>
/// <param name="target"></param>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Param not commented :)

/// Initializes a builder to configure the snapshot
/// </summary>
/// <param name="target"></param>
/// <returns></returns>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

returns not commented :)

/// </summary>
/// <param name="configure"></param>
/// <returns></returns>
ISnapshotBuilder ConfigureOptions(Func<MatchOptions, MatchOptions> configure);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could make this ConfigureOptions private (but we need a little refactoring then)

/// <summary>
/// Configures the name extension
/// </summary>
/// <param name="extensions"></param>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

param & returns empty

/// <returns></returns>
public static ISnapshotBuilder NameExtension(
this ISnapshotBuilder builder,
string extensions)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a params string[]


/// <summary>
/// Configures the name extension. The value passed as <paramref name="extensions"/> will be
/// added to the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description is not finished.

/// <summary>
/// Configures the name of this snapshot
/// </summary>
/// <param name="extensions"></param>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename extensions to 'name'

namespace Snapshooter
{
public static class SnapshotBuilderExtensions
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should include the extensions to the ISnapshotBuilder interface and add it to the SnapshotBuilder. Then we could make the ConfigureOptions as a protected field and we can remove it from the interface.
It would also have the advantage, that if someone checks the ISnapshotBuilder interface (which options do exists), then the person sees immediately what kind of functions are there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants