Iniciamos o SpecFlow no Azure DevOps em um post anterior e agora vamos demonstrar a aplicabilidade do SpecFlow utilizando o Visual Studio. Comece adicionando o SpecFlow for Visual Studio em Extensões e Atualizações.

Em seguida, crie dois novos projetos: 1) Projeto de Teste de Unidade 2) Projeto a ser testado, no meu caso utilizei Biblioteca de Classes (.NET Framework).

No projeto de Teste, clique com o botão direito e “Gerenciar pacotes do NuGet…”. Adicione o SpecRun.SpecFlow.

Ainda no Projeto de Teste, adicione um novo item > SpecFlow Feature File. No arquivo da feature gerado, clique com o botão direito no código e “Generate Step Definitions”.

Um arquivo .cs será criado com a estrutura do teste a ser realizado. Utilizamos uma classe bem simples (arquivo Class1.cs do projeto ClassLibrary1) para realizar os testes. Lembre-se de no Projeto de Teste referenciar:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ClassLibrary1;
(adicione a referência com o botão direito Adicionar > Referência > Projeto > Solução > checar o projeto a ser testado)


Like this:
Like Loading...
Related
Published by Leonardo Matsumota
PROFILE
• 18+ years of experience in IT Projects, systems development and data analysis
• Evangelist in DevOps practices (Azure DevOps; CI/CD) and ALM
• Microsoft MVP (Most Valuable Professional) - Developer Technologies
• Architecture, Cloud, Business Intelligence, Data Mining and Machine Learning
• Digital marketing UX, SEO and Google advertising campaigns
Website: https://leonardo-matsumota.com/
SPECIALTIES
• Governance: Agile | Scaled Agile | Traditional (PMBOK) | Kanban | Lean Six Sigma
• Development: ALM | DevOps | APIs | QA | Cloud
• Data Management: Oracle and SQL Server | Power BI | Python and R
CERTIFICATIONS
• KMP - Kanban Management Professional
• SAFe 4 Certified Agilist - 47115872-3333
• Green Belt - Lean Six Sigma
• PSM I (Professional Scrum Master)
• PMP (Project Management Professional) 1582886
• Oracle SQL 1Z0-007
• Oracle Fundamentals IZ0-031
• Competency in English - Michigan
EDUCATION
• Certificate in Business Dynamics
• Master in Production Engineering (Stricto Sensu)
• MBA in Business Management with emphasis in Project Management
• MBA in Information Technology Management
• Bachelor of Computer Science
View all posts by Leonardo Matsumota