This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using FluentAssertions; | |
using Xunit; | |
namespace calculation.tests | |
{ | |
public class CalculationTests | |
{ | |
[Theory] | |
[InlineData(1, 1, 2)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--The content below is only a placeholder and can be replaced.--> | |
<div style="text-align:center"> | |
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg=="> | |
</div> | |
<button data-cy="first" (click)="first()" data-cy="first">First button</button> | |
<button data-cy="second" (click)="second()" data-cy="second">Second button</button> | |
<button data-cy="third" (click)="third()" data-cy="third">Third button</button> | |
<article data-cy="content">{{whatHappened}}</article> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.css'] | |
}) | |
export class AppComponent { | |
whatHappened = 'nothing'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Index tests', function () { | |
before(function () { | |
// runs once before all tests in the block | |
}) | |
after(function () { | |
// runs once after all tests in the block | |
}) | |
beforeEach(function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { environment } from './../environments/environment'; | |
import { Directive, ElementRef, Renderer2 } from '@angular/core'; | |
@Directive({ | |
// tslint:disable-next-line:directive-selector | |
selector: '[data-cy]' | |
}) | |
export class DataCyDirective { | |
constructor(private el: ElementRef, private renderer: Renderer2) { | |
if (environment.production) { | |
renderer.removeAttribute(el.nativeElement, 'data-cy'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | |
"version": 1, | |
"newProjectRoot": "projects", | |
"projects": { | |
"datacy": { | |
"root": "", | |
"sourceRoot": "src", | |
"projectType": "application", | |
"prefix": "app", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
module.exports = { | |
module: { | |
rules: [{ | |
test: /\.html$/, | |
use: ['data-cy-loader'] | |
}] | |
}, | |
resolveLoader: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function dataCyLoader(source) { | |
var dataAttr= 'data-cy=\"([^"]*)\"'; | |
if(source.match(dataAttr)){ | |
source = source.replace(new RegExp(dataAttr, 'g'), ''); | |
} | |
return source; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
fs.rename('webpack.extra.js', 'webpack.extra_.js', function (err) { | |
if (err) console.log('ERROR: ' + err); | |
fs.rename('webpack.test.js', 'webpack.extra.js', function (err) { | |
if (err) console.log('ERROR: ' + err); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BirthDay | |
{ | |
public int DayOfMonth { get; set; } | |
public int Month { get; set; } | |
public int Year { get; set; } | |
public int DaysToNextBirthDay() | |
{ | |
var today = DateTime.Today; | |
var birthDayThisYear = new DateTime(today.Year, Month, DayOfMonth); |