Skip to content

Instantly share code, notes, and snippets.

View ThiagoBarradas's full-sized avatar
👽
em marte!

Thiago Barradas ThiagoBarradas

👽
em marte!
View GitHub Profile
public enum CorSemFlags // enumerador comum
{
Vermelho = 1,
Verde = 2,
Azul = 4,
Amarelo = 8
}
[Flags]
public enum Cor // usando flags, basta adicionar o atributo
@ThiagoBarradas
ThiagoBarradas / PRIVACY.md
Last active July 5, 2019 00:50
PRIVACY.md

Privacy Policy

Effective date: July 05, 2019

ThiagoBarradas Projects ("us", "we", or "our") operates the https://github.com/ThiagoBarradas website (the "Service").

This page informs you of our policies regarding the collection, use, and disclosure of personal data when you use our Service and the choices you have associated with that data. Our Privacy Policy for ThiagoBarradas Projects is created with the help of the Free Privacy Policy Generator.

We use your data to provide and improve the Service. By using the Service, you agree to the collection and use of information in accordance with this policy. Unless otherwise defined in this Privacy Policy, terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, accessible from https://github.com/ThiagoBarradas

from __future__ import print_function
import requests
import sys
import time
import os
def main():
trigger_url = sys.argv[1]
access_token = sys.argv[2]
requests==2.8.1
future==0.18.2
@ThiagoBarradas
ThiagoBarradas / azure-devops-sonarqube-job
Created June 27, 2019 01:49
azure-devops-sonarqube-job
- job: qa_analysis
dependsOn: unit_tests
steps:
- task: DownloadPipelineArtifact@2
inputs:
artifact: UnitTestResults
- script: |
pwd && ls -la
ls -la $(project_name).Tests
ls -la $(Pipeline.Workspace)
@ThiagoBarradas
ThiagoBarradas / xunit-theory-hybrid.cs
Last active January 25, 2021 16:08
xUnit Theory Hybrid (MemberData + ClassData) Sample
// test parameters
public class SendEmailParameters()
{
public static IEnumerable<object[]> Parameters()
{
// parameters to test send email success
yield return new object[]
{
new SendEmailModel
@ThiagoBarradas
ThiagoBarradas / xunit-theory-classdata.cs
Last active January 25, 2021 16:07
xUnit Theory ClassData Sample
// class with parameters
public class SendEmailParameters : IEnumerable<object[]>
{
public IEnumerator<object[]> GetEnumerator()
{
// parameters to test send email success
yield return new object[]
{
new SendEmailModel
@ThiagoBarradas
ThiagoBarradas / xunit-theory-memberdata.cs
Last active March 6, 2023 17:50
xUnit Theory MemberData Sample
// models for example
public class SendEmailModel
{
public string Content { get; set; }
public string Email { get; set; }
}
public class SendEmailResult
[Theory]
[InlineData("user@provider.com", true)]
[InlineData("wrong-user", false)]
public static void SendEmail_Should_Validate_Email(string email, bool expectedResult)
{
// arrange
var content = "hello friend!";
var emailSender = new EmailSender();
// act
@ThiagoBarradas
ThiagoBarradas / xunit-fact-duplicate.cs
Last active January 25, 2021 16:05
xUnit Fact Sample 2
[Fact]
public static void SendEmail_Should_Return_Failed_When_Receives_A_Invalid_Email()
{
// arrange
var email = "wrong-email";
var content = "hello friend!";
var emailSender = new EmailSender();
// act
var emailSended = emailSender.SendEmail(content, email);