Skip to content

Instantly share code, notes, and snippets.

Avatar

Maicon Heck maiconheck

View GitHub Profile
@maiconheck
maiconheck / VS-Shortcuts-CheatSheet.md
Last active Oct 17, 2020
VS Shortcuts CheatSheet
View VS-Shortcuts-CheatSheet.md

My Visual Studio Shortcuts CheatSheet

The frequently used / custom shortcuts


Edit / File

Code Cleanup Format Document Insert Snippet Surround With
Ctrl+K, Ctrl+E Ctrl+K, Ctrl+D Ctrl+K, Ctrl+X Ctrl+K, Ctrl+S
@maiconheck
maiconheck / Lead.cs
Last active Nov 24, 2019
Capturar Leads Context
View Lead.cs
using System;
using System.Collections.Generic;
using System.Linq;
namespace DddBuildingBlocks.Domain.CapturarLeadsContext
{
public class Lead : Verifiable
{
private readonly List<Segment> _segments;
@maiconheck
maiconheck / Lead.cs
Created Nov 24, 2019
Executar Campanha Context
View Lead.cs
using System.Collections.Generic;
using System.Linq;
namespace DddBuildingBlocks.Domain.ExecutarCampanhaContext
{
public class Lead
{
private readonly List<Segment> _segments;
public Lead()
View InitializeLead.cs
var email = new Email(emailAddress);
var lead = new Lead(email);
var name = new Name(firstName, lastName);
var phone = new PhoneNumber(ddd, phoneNumber);
var address = new Address(zipCode, street, streetNumber, neighborhood, complement);
lead.Update(name, email, phone, address, gender, birthDate);
@maiconheck
maiconheck / Lead.cs
Last active Feb 3, 2021
[4º Improvement]
View Lead.cs
using System;
using System.Collections.Generic;
using System.Linq;
using DddBuildingBlocks.Domain.Core;
using DddBuildingBlocks.Domain.ValueObjects.Core;
namespace DddBuildingBlocks.Domain.Entities.Core
{
public class Lead : Verifiable, ILead
{
View AddressTest.cs
using Xunit;
using DddBuildingBlocks.Domain.ValueObjects;
namespace DddBuildingBlocks.Tests.Domain.ValueObjects
{
[Trait("Category", nameof(Domain))]
public class AddressTest
{
[Theory]
[InlineData("79074-047")]
View PhoneNumberTest.cs
using Xunit;
using DddBuildingBlocks.Domain.ValueObjects;
namespace DddBuildingBlocks.Tests.Domain.ValueObjects
{
[Trait("Category", nameof(Domain))]
public class PhoneNumberTest
{
[Theory]
[InlineData("11")]
View EmailTest.cs
using Xunit;
using DddBuildingBlocks.Domain.ValueObjects;
namespace DddBuildingBlocks.Tests.Domain.ValueObjects
{
[Trait("Category", "Domain")]
public class EmailTest
{
[Fact]
public void ToString_Email_String()
View NameTest.cs
using Xunit;
using DddBuildingBlocks.Domain.ValueObjects;
namespace DddBuildingBlocks.Tests.Domain.ValueObjects
{
[Trait("Category", nameof(Domain))]
public class NameTest
{
[Theory]
[InlineData("Lucas Luís", "Cruz")]
View Verifiable.cs
using System;
namespace DddBuildingBlocks.Domain
{
public abstract class Verifiable
{
public bool Valid { get; private set; }
protected void Assert(Func<bool> expression) => Valid = expression?.Invoke() ?? false;
}