Commit Graph
5 Commits
Author SHA1 Message Date
zheng elendil 1d0743da36 Fix Spider base class null context issue and remove deprecated UnitTest1 2026-03-29 09:26:38 +08:00
zheng elendil eb15a3afb5 Add Fluent API unit tests and restore .NET 10.0 target
- Changed NScrapy.Core target framework from net8.0 back to net10.0
- Added NScrapy.Core project reference to NScrapy.Test
- Created FluentApiTests.cs with the following test cases:
  - TestSpiderBuilder_CanCreateSpiderWithName
  - TestSpiderBuilder_BuildCreatesSpider
  - TestSpiderBuilder_SetsStartUrls
  - TestSpiderBuilder_AddsPipeline
  - TestDistributedBuilder_SetsRedisConfig
  - TestSpiderOptions_DefaultValues
  - TestDistributedBuilder_Chaining
  - TestSpiderBuilder_ConfiguresOptions
- Added helper classes TestItem and TestPipeline for testing pipelines
2026-03-28 22:30:44 +08:00
zheng elendil af3343fa03 Fix Spider.cs: use config dict instead of reflection for RedisSchedulerContext
- Replace broken reflection approach with direct config dictionary manipulation
- RedisSchedulerContext.Connect() reads config at runtime from NScrapyContext.CurrentContext.CurrentConfig
- Set config values BEFORE RedisScheduler singleton is created
- Also fix TargetFramework from net10.0 to net8.0
2026-03-28 22:25:54 +08:00
zheng elendil cc95cf9ddc Add ResponseHandler override to satisfy abstract base class 2026-03-28 22:25:24 +08:00
zheng elendil 9f0210ccdc Add NScrapy.Core project with Fluent API architecture
- Add new NScrapy.Core project with Fluent API for spider creation
- Add Fluent/NScrapy.cs - Static entry class with CreateSpider(name)
- Add Fluent/ISpiderBuilder.cs - Builder interface for fluent configuration
- Add Fluent/SpiderBuilder.cs - Builder implementation
- Add Fluent/IDistributedBuilder.cs - Distributed config interface
- Add Fluent/DistributedBuilder.cs - Distributed config implementation
- Add Fluent/ISpider.cs - New spider runtime interface
- Add Fluent/Spider.cs - Spider implementation inheriting from base Spider
- Add Fluent/SpiderOptions.cs - Configuration options class
- Add Middleware/JsRenderMiddleware.cs - Stub middleware (not implemented)
- Update solution file to include NScrapy.Core project
2026-03-28 22:16:34 +08:00