A free product in one line
@Sample writes sample(...) for a struct, so a test passes only the values it is about and every other property gets its default.
SampleTests.swift
@Test("A sample changes only the properties the test passes") func sampleOverridesOnlyTheGivenProperties() { let tags = ["home"] let free = Product.sample(price: 0, tags: tags) let expected = Product( id: Product.sample().id, name: "", price: 0, tags: tags, stock: 5, currency: "EGP", seller: Seller.sample() ) #expect(free == expected) }