Testing - open a testing workbook
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- csharp
- Ambito
- testing-qa, tooling
Direzione di ricerca
Inizia con la WorkbookFixture proposta nell’assembly ExcelDna.Testing ed esamina le cartelle di lavoro di XFunctions Examples, in particolare HelpExamples.xlsx. Esamina come xUnit IClassFixture dovrebbe fornire la cartella di lavoro, quindi risolvi le questioni aperte dell’issue relative all’individuazione, all’apertura e alla chiusura delle cartelle di lavoro di test. Il lavoro è completato quando è definito un design del fixture che supporta l’esecuzione dei test su una cartella di lavoro precreata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I think it would be nice to be able to run all the test from a class in the context of a pre-created workbook.
I'm trying to understand what the xUnit way to set this up would be.
For example, in the XFunctions add-in, I have some example workbooks:
https://github.com/Excel-DNA/XFunctions/tree/master/Examples
I want to make tests for the XFunctions add-in that execute in the context of one of those workbooks.
I suggest we add a WorkbookFixture class in the ExcelDna.Testing assembly that looks like this:
public class WorkbookFixture : IDisposable
{
public Workbook Workbook { get; }
public WorkbookFixture(string name)
{
// Look for the workbook in the test directory or somewhere close
// not sure what the path search story should be - do we allow partial paths like testbook/myBook.xlsx ?
// in practise one might want the test workbook in the test project directory, not the test output directory?
// Anyway, once we've found it we open it.
}
public Dispose() { // Close it? }
}
For the test code, maybe something like this could then work.
Suppose there is a file called HelpExamples.xlsx in a good directory.
Then the test gets a class that subclasses the WorkbookFixture, passing in the name as constructor parameter.
public class HelpExamplesFixture : base("HelpExamples.xlsx") {}
public class HelpExampleTests : IClassFixture<HelpExamplesFixture>
{
Workbook _wb;
public HelpExampleTests(HelpExamplesFixture fixture) { _wb = fixture.Workbook; };
[Fact]
public void CheckSomething()
{
Assert.Equal(_wb.Range["A1"], 123);
}
}
@Sergey-Vlasov Do you have any thoughts on how this should work?
- Lingua principale
- C#
- Stelle
- 0
- Fork
- 2
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Excel-DNA/DeveloperTools
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
Excel-DNA/DeveloperTools#24 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
Excel-DNA/DeveloperTools#16 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
Excel-DNA/DeveloperTools#15 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Excel-DNA/DeveloperTools#14 · 4 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Tutte le issue di Excel-DNA/DeveloperTools
Issue simili
-
core dependencies
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
-
bug frontend good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
NavigationViewItemAutomationPeer implements IInvokeProvider but never advertises the Invoke pattern Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
unoplatform/uno#24629 ·
-
agentic-workflows Needs: Triage :mag: State: In-PR
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Down / Waiting for removal
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100